數(shù)碼管流水燈式顯示數(shù)據(jù)
本程序是采用51單片機(jī)實(shí)現(xiàn)共陽數(shù)碼管流動(dòng)顯示數(shù)據(jù),蠻好看的,所以把程序?qū)懗鰜砗痛蠹乙黄鸱窒硪幌拢。?/p>本文引用地址:http://www.ex-cimer.com/article/170848.htm
電路圖在下面
下面是匯編程序代碼:
D0 BIT P2.0
D1 BIT P2.1
D2 BIT P2.2
D3 BIT P2.3
D4 BIT P2.5
ORG 0000H
SJMP START
ORG 0040H
START:MOV SP,#60H
MOV R0,#00H
MOV R1,#20
MOV DPTR,#TABLE
SETB D4
MOV A,R0
MOVC A,@A+DPTR //1
MOV P0,A
CLR D0
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //2
MOV P0,A
SETB D0
CLR D1
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //3
MOV P0,A
SETB D1
CLR D2
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //4
MOV P0,A
SETB D2
CLR D3
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //5
MOV P0,A
SETB D3
CLR D0
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //6
MOV P0,A
SETB D0
CLR D1
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //7
MOV P0,A
SETB D1
CLR D2
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //8
MOV P0,A
SETB D2
CLR D3
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //9
MOV P0,A
SETB D3
CLR D0
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //10
MOV P0,A
SETB D0
CLR D1
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //11
MOV P0,A
SETB D1
CLR D2
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //12
MOV P0,A
SETB D2
CLR D3
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //13
MOV P0,A
SETB D3
CLR D0
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //14
MOV P0,A
SETB D0
CLR D1
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //15
MOV P0,A
SETB D1
CLR D2
LCALL DELAY
MOV R1,#20
INC R0
MOV A,R0
MOVC A,@A+DPTR //16
MOV P0,A
SETB D2
CLR D3
LCALL DELAY
SETB D3
LJMP START
DELAY:MOV R7,#200
DEL1:MOV R6,#125
DEL2:DJNZ R6,DEL2
DJNZ R7,DEL1
DJNZ R1,DELAY
RETTABLE:DB 0C0H,0F9H,0A4H,0B0H
DB 99H,92H,82H,0F8H
DB 80H,90H,88H,83H
DB 0C6H,0A1H,86H,8EH
END
評論