DFGGHJK

ALE BIT P3.4 OE BIT P3.6 SOC BIT P3.5 EOC BIT P3.7 ADD_A BIT P2.5 ADD_B BIT P2.6 ADD_C BIT P2.7 RS BIT P3.

0 RW BIT P3.1 EN BIT P3.2 MSG1: MSG2: MSG3: MSG4: MSG5: MSG6: MSG7: DB DB DB DB DB DB DB ORG 0500H 01H,06H,02H,0EH,80H,0 'HOT',0 'COOL',0 'MODERATE',0 'BRIGHT',0 'DARK',0 'NORMAL',0

ORG 0550H ADCCONV: MOV P0,#0FFH SETB EOC CLR ALE CLR SOC CLR OE MOV P2,A ACALL DELAY SETB ALE ACALL DELAY SETB SOC ACALL DELAY CLR ALE CLR SOC HERE: JNB EOC,HERE SETB OE ACALL DELAY MOV A,P0 CLR OE ACALL CONV RET ORG 0000H BACK:MOV DPTR,#MSG1 LCALL CMDDISP MOV A,#20H LCALL ADCCONV LCALL TCMP LCALL DTDISP MOV A,#40H LCALL ADCCONV LCALL BCMP LCALL DTDISP SJMP BACK

#MSG5 RET JC A2 JMP A3 MOV DPTR.#MSG6 RET MOV DPTR.#MSG3 RET MOV DPTR.#0AAH.Q2 CJNE A.#MSG4 RET MOV DPTR.7.#MSG1 RET CJNE A.CMDWRT: ACALL READY MOV P1.L1 JC A1 CJNE A.L2 .#55H.#0AAH.Q1 JC W1 CJNE A.A CLR RS SETB RW SETB EN ACALL DELAY CLR EN RET DATAWRT: ACALL READY MOV P1.#55H.A SETB RS SETB RW SETB EN ACALL DELAY CLR EN RET READY: SETB P1.WAIT RET TCMP: L1: L2: A1: A2: A3: BCMP: Q1: Q2: W1: W2: W3: JC W2 JMP W3 MOV DPTR.7 CLR RS SETB RW WAIT: CLR EN ACALL DELAY SETB EN JB P1.#MSG7 RET MOV DPTR.

@A+DPTR JZ DOWN1 ACALL CMDWRT INC DPTR SJMP CMDDISP DOWN1: RET DTDISP:CLR A MOVC A.@A+DPTR JZ DOWN2 ACALL DATAWRT INC DPTR SJMP DTDISP DOWN2: RET .CMDDISP:CLR A MOVC A.

Sign up to vote on this title
UsefulNot useful