流水灯和数码管的定时问题
要求数码管从9秒倒计时,一秒一个数,已完成流水灯的定时请各位高手帮忙看看程序如下:
ORG 0000H
AJMP START
ORG 000BH
AJMP INT_SUB
ORG 0200H
START:MOV R7,#05H
MOV A,#7FH
MOV SP,#30H
MOV TMOD,#01H
MOV TH0,#9EH
MOV TL0,#058H
SETB ET0
SETB EA
SETB TR0
LOOP1:MOV P3,#00H
CALL DL
MOV P3,#0FFH
CALL DL
JMP LOOP1
SJMP $
INT_SUB:
MOV TH0,#9EH
MOV TL0,#058H
DJNZ R7,LOOP
RL A
MOV P1,A
MOV R7,#05H
LOOP:
RETI
DL:MOV R1,#0FFH
D1:MOV R2,#0FFH
D2:DJNZ R2,D2
DJNZ R1,D1
RET
END
页:
[1]