数码管静态显示(出来的结果好奇怪,求问要怎么改)
静态显示
MOV R0,#0
START: MOV A,R0
MOV DPTR,#TAB1
MOVC A,@A+DPTR
MOV P2,A
MOV A,R0
MOV DPTR,#TAB2
MOVC A,@A+DPTR
MOV P3,A
INC R0
ACALL DELAY
CJNE R0,#10H,START
MOV R0,#0
SJMP START
DELAY:
MOV R2,#10
L1: MOV R3,#200
L2: MOV R4,#250
L3: DJNZ R4,L3
DJNZ R3,L2
DJNZ R2,L1
ret
;;共阴极数码管段码
TAB1:
DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH,77H,7CH
DB 39H,5EH,79H,71H,73H,3EH,31H,6EH,76H,38H,00H
;;共阳极数码管段码
TAB2: DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H
DB 80H,90H,88H,83H,0C6H,0A1H,86H,8EH
DB 8CH,0C1H,0CEH,91H,89H,0C7H,0FFH
END