流水灯还要什么电路图?阴极随便接2 个IO口,阳极串一小电阻(320~510)到+5V 。
ORG 0000H
AJMP MAIN
ORG 0030H
MAIN: MOV R0,#8
MOV A,#0FEH
DISP: MOV P0,A
ACALL DLY200
RL A
DJNZ R0,DISP
MOV R0,#8
MOV P0,#0FFH
DISP1: MOV P1,A
ACALL DLY200
RL A
DJNZ R0,DISP1
MOV R0,#8
MOV P1,#0FFH
AJMP DISP
DLY200: ;延时200us,误差 0us
MOV R7,#04H
DL1:
MOV R6,#74H
DL0:
MOV R5,#0D6H
DJNZ R5,$
DJNZ R6,DL0
DJNZ R7,DL1
NOP
RET
END
只能循环,不能灭。应该用CJNE控制它的次数