设计一款单片机控制系统,实现8只共阴极LED数码管同时显示"12345678"

2024-11-18 16:29:32
推荐回答(1个)
回答1:

采用共阴极LED数码管51单片机P1口输数据:ORG 0000H
JMP MAIN
ORG 0100H
MAIN:MOV DPTR,#TAB
MOV R1,#00H
DISP:MOV A,R1
MOVC A,@A+DPTR
MOV P1,A
LCALL DELAY
INC R1
CJNE R1,#0AH,DISP
SJMP $
TAB: DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FHDELAY: MOV R4,#2
DELAY100MS:MOV R5,#200
DELAY5MS: MOV R6,#250
LOOP: DJNZ R6,LOOP
DJNZ R5,DELAY5MS
DJNZ R4,DELAY100MS
RET