本文包含原理图、PCB、源代码、封装库、中英文PDF等资源
您需要 登录 才可以下载或查看,没有账号?注册会员
×
ORG 0000H
AJMP MAIN
ORG 0100H
START:MOV DPTP,#4000H
MOVX @DPTR,A
LOOP:CJNE P3.3,#0,LOOP
MOVX A,@DPTR
COMP:MOV B,#03 H
MOV B,#06H
DIV AB
MOV B,A
MOV A,#0A0H
CLR C
SUBB A,B
CJNE A,#0AH,COMP1
COMP1:JNC COMP4
CJNE A,#97H,COMP2
COMP2:JC COMP3
COMP3:RET
COMP4:MOV 2AH,#0FH
MOV 2BH,0FH
MOV 2CH,#0FH
ACALL DISP
MOV R1,#00H
MOV R2,#00H
CHAN:CLR C
SUBB A,#64H
JC CHAN1
INC R1
AJMP CHAN2
CHAN1:ADD A,#64H
CHAN2:SUBB A,#0AH
JC CHAN3
INC R2
AJMP CHAN2
CHAN3:ADD A,#0AH
MOV 2AH,R1
MOV 2BH,R2
MOV 2CH,A
DISO:MOV P2,#0FEH
MOV R1,2AH
MOV DPTR,DSEG
MOVX P1,
ACSLL DELAY
MOV A,#0FD H
MOV R1,2CH
MOV DPTR,DSEG
MOVX PA, @DPTR+A
ACALL DELAY
MOV A,#0FB H
MOV R1,2BH
MOV DPTR,DSEG
MOVX P1,@DPTR+A
ACALL DELAY
MOV A,#0FD H
MOV R1,2CH
MOV DPTR,DSEG
MOVX P1, @DPTR+A
ACALL DELAY
AJMP START
DELAY:MOV R4,#02H
DELAY1:MOV R5,0FFH
DJNZ R4,DELAY1 |