汇编语言,利用AT89C51单片机结合8个发光二极管L0~L7,要求每间隔0.5秒依次点亮一盏灯,

2025-01-06 02:46:34
推荐回答(2个)
回答1:

ORG 0000H
LJMP MAIN
ORG 0030H
MAIN:
MOV R2,#3
MOV A,#0FEH
LOOP:
MOV P1,A
LCALL DELAY
RL A
DJNZ R2,LOOP
MOV P1,#0FFH
SJMP $
DELAY:
MOV R3,#10
DLY1:
MOV R4,#100
DLY2:
MOV R5,#250
DJNZ R5,$
DJNZ R4,DLY2
DJNZ R3,DLY1
RET
END

回答2:

想要定时,先要说清楚,你用的晶振频率是多少。