基于51单片机的LED点阵显示系统的设计与实现。

给你一个源代码,自己分析,用汇编写。我个人写完之后试了一下,只有C8052S的一个最低系统才能工作驱动市面上5.0美元的单元板(32*64)。

;============================================

;32*64点阵屏幕左滚动显示N个汉字程序

;============================================

d _ FR0 EQU 40H;第一显示数据缓冲器

EQU 70H

d _ MB EQU 30H;数据位移位数寄存器

d _ AM EQU 31H;显示半角字数的寄存器

DAMT EQU 32H;用于显示半宽度字数量的多个寄存器

偏移EQU 33H;数据指针偏移

RED0位P1.4

红色1位P3.1

RCK钻头p 1.5;锁存信号线

SCK钻头p 1.6;移位时钟信号线

EN位p 1.7;消隐信号线

;-程序入口地址。

组织0000H

JMP起点

ORG 0030H

;====================================

;初始化

;====================================

开始:

CLR A

MOV 60H,A

MOV 61H,A

MOV 62H,A

MOV 63H,A

MOV SP,# 0AH修改堆栈指针

MOV R7,5号

MOV R0,#D_FR0

MOV R1,#D_FR1

ST1:MOV @R0

MOV @R1,A

INC R0

INC R1

DJNZ R7,ST 1;40小时-44小时

MOV R7,#20H

MOV R0,#D_MB

ST2:MOV @R0,A

INC R0

DJNZ R7,ST2寄存器被清除,

MOV P1,#0ffH

MOV DPTR,#表1

DPL MOV 62H

DPH MOV 63H

MOV·DPTR #表2

DPL MOV 64H

DPH MOV 65H

MOV DAMT,# 1;所显示的半角单词数的倍数。

MOV·R4,排名第二

;====================================

;主程序

;====================================

主要:

MOV R5,# 16;扫描16行

MOV偏移量,# 00H数据指针偏移被清除为0。

MA1:调用曲书;调用获取子程序

呼叫DSEND呼叫发送子程序

clr EN关闭显示器

Inc p 1;修改行值

CLR RCK

SETB·RCK;锁存显示数据

setb EN打开显示

DJNZ R5,ma 1;16行未完成。继续。

美因河畔R4

MOV·R4,排名第五;移动速度

公司D_MB

MOV A,D_MB

CJNE A,#8,M_OUT

MOV D_MB,# 0;1个半角字符将被移动8次。

MOV A,#16

MOV·DPL,62岁

MOV·DPH,63岁

加一个,DPL

MOV·DPL

DPL MOV 62H

DPH MOV

ADDC A,#00H

MOV·DPH

DPH MOV 63H

MOV A,#16

MOV·DPL,64岁

MOV·DPH,65岁

加一个,DPL

MOV·DPL

DPL MOV 64H

DPH MOV

ADDC A,#00H

MOV·DPH

DPH MOV 65H

公司D_AM

美国MOV

CJNE A,#30,M _ OUT显示的半角字符数

MOV D_AM,#00H

DJNZ DAMT,M_OUT

MOV DAMT,# 1;所显示的半角单词数的倍数。

MOV DPTR,#表1

DPL MOV 62H

DPH MOV 63H

MOV·DPTR #表2

DPL MOV 64H

DPH MOV 65H

MOV P1,#0ffH

M_OUT: JMP大街

;===================================

;取一个行号子程序

;===================================

曲书:

MOV R7,9号

MOV R0,#D_FR0

MOV·DPL,62岁

MOV·DPH,63岁

推DPL

推DPH

MOV A,抵消

QUSHU1:

加一个,DPL

MOV·DPL

DPH MOV

ADDC A,#00H

MOV·DPH

CLR A

MOVC A,@A+DPTR

MOV @R0,A

INC R0

MOV A,#16

DJNZ R7,QUSHU1

波普·DPH

波普·DPL

DPL MOV 62H

DPH MOV 63H

曲树2:

MOV R7,9号

MOV R0,#D_FR1

MOV·DPL,64岁

MOV·DPH,65岁

推DPL

推DPH

MOV A,抵消

曲树3:

加一个,DPL

MOV·DPL

DPH MOV

ADDC A,#00H

MOV·DPH

CLR A

MOVC A,@A+DPTR

MOV @R0,A

INC R0

MOV A,#16

DJNZ R7,QUSHU3

波普·DPH

波普·DPL

DPH MOV 65H

DPL MOV 64H

公司偏移量

浸水使柔软

;===================================

;数据发送子程序

;===================================

DSEND:

MOV R0,# D _ FR0R0是第一个显示数据缓冲地址的人。

MOV R1,#D_FR1

MOV·R6,排名第八;发送n字节(1行)

DSE1:MOV R7,# 8;一次发送8位

MOV 60H,@R0

MOV 61H,@ r 1;在中显示数据

CPL 60H

CPL 61H;倒置a

DSE2: MOV A,60H

RLC A;根据将a的内容移入c。

MOV红0,C;将c的内容发送到数据总线

MOV 60H,A

MOV A,61H

RLC A

MOV红1,C

MOV 61H,A

CLR SCK

SETB·SCK;输出移位脉冲

DJNZ R7,DSE2

INC R0

INC r 1;修改地址指针

DJNZ R6,DSE1

;-将屏幕向左移动一个位置。

MOV A,D _ MB移动的位数放入。

JZ·塔曼德;0的传输

MOV R7,D _ MB移动的位数放入R7。

MOV 60H,@R0

MOV 61H,@R1

cpl 60H移动的数据存储在。

CPL 61H

DSE3:MOV A,60H

RLC A;根据将a的内容移入c。

MOV红0,C;将c的内容发送到数据总线

MOV 60H,A

MOV A,61H

RLC A

MOV红1,C

MOV 61H,A

CLR SCK

SETB·SCK;输出移位脉冲

DJNZ R7,DSE3轮班次数没有继续。

;-轮班时间校正。

TAMEND:CLR C;清c

MOV A,#100

SUBB A,D _ MB再次延迟的次数

JZ D_OUT

MOV R7,A

TA1:无

nototherwiseprovided(for)除非另有规定

nototherwiseprovided(for)除非另有规定

nototherwiseprovided(for)除非另有规定

DJNZ R7,ta 1;怠速运行(延迟)

D_OUT:返回

;====================================

;字符编码表

;====================================

表1:

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,0FCH,04H,45H,46H,28H,28H,10H,28H,24H,44H,81H,01H,02H,0CH

DB 80H,80H,80H,0FCH,04H,48H,40H,40H,0A0H,0A0H,10H,08H,0EH,04H

DB 00H,41H,26H,14H,04H,04H,0F4H,14H,15H,16H,14H,10H,10H,10H,28H,47H,00H

DB 00H,84H,7EH,44H,44H,44H,44H,0C4H,44H,54H,48H,40H,40H,46H,0FCH,00H

DB 01H、21H、1H、09H、09H、01H、0FFH、04H、04H、04H、08H、08H、10H、20H、40H

DB 00H、08H、0CH、10H、20H、04H、0FEH、40H、40H、40H、40H、42H、42H、3EH、00H

DB 10H、10H、51H、51H、52H、54H、58H、50H、57H、54H、54H、54H、14H、17H、14H

DB 80H,80H,04H,0FEH,00H,80H,60H,24H,0FEH,44H,44H,44H,44H,0FCH,04H

DB 00H,01H,03H,03H,03H,03H,01H,01H,01H,00H,01H,00H,03H,01H,00H

00H,80H,0C0H,0C0H,0C0H,0C0H,80H,80H,80H,00H,80H,00H,00H,0C0H,80H,00H,00H

DB 00H,40H,30H,17H,00H,02H,0f 10H,10H,10H,10H,10H,110H,12H,28H,47H,00H

DB 80H,40H,48H,0FCH,10H,10H,20H,0A0H,40H,40H,0A0H,10H,10H,06H,0FCH,00H

DB 00H,3FH,21H,21H,3FH,21H,21H,21H,3FH,01H,01H,7FH,01H,01H,0FFH,00H

DB 08H,0FCH,08H,08H,0F8H,08H,08H,08H,00H,08H,0FCH,00H,04H,0FEH,00H

DB 0FH,08H,08H,0FH,08H,08H,0FH,00H,0FFH,01H,09H,09H,09H,15H,23H,40H

DB 0E0H,20H,20H,0E0H,20H,20H,0E0H,04H,0FEH,00H,20H,0F0H,00H,00H,00H,06H,0FCH

DB 42H,32H,12H,02H,9FH,62H,22H,0FH,18H,28H,0C8H,48H,48H,4FH,48H,40H

DB 04H,3EH,24H,24H,0E4H,3CH,0A4H,0E4H,0A4H,0BCH,0A4H,0A4H,0A4H,0A4H,54H,88H

DB 04H,04H,04H,04H,04H,7CH,04H,04H,04H,04H,04H,04H,1CH,0E4H,44H,00H

DB 80H,80H,88H,98H,0A0H,0C0H,80H,80H,80H,80H,80H,80H,82H,82H,7EH,00H

DB 01H,09H,09H,11H,11H,20H,03H,0CH,3FH,0C8H,0FH,08H,0FH,08H,0FH,08H,0FH,08H

DB 00H,20H,10H,0CH,24H,0C0H,00H,08H,0FCH,08H,0F8H,08H,0F8H,08H,08H,08H

DB 01H,01H,7FH,41H,81H,02H,02H,05H,09H,18H,28H,48H,88H,0AH,0CH,08H

DB 00H,00H,0FEH,02H,04H,00H,08H,18H,20H,0C0H,80H,40H,30H,0EH,04H,00H

DB 04H,04H,04H,04H,44H,24H,24H,14H,14H,14H,14H,04H,04H,04H,0FFH,00H

DB 40H,40H,40H,40H,44H,44H,48H,48H,50H,50H,60H,40H,40H,44H,0FEH,00H

DB 04H,0EH,0F8H,08H,08H,0FEH,08H,1CH,1AH,29H,28H,48H,88H,08H,08H,08H

DB 10H,10H,90H,50H,10H,90H,50H,14H,1EH,0F0H,10H,10H,10H,10H,10H,10H,10H,10H

DB 22H,11H,11H,00H,7FH,40H,80H,1FH,00H,01H,0FFH,01H,01H,01H,01H,05H,02H

DB 08H,08H,10H,20H,0FEH,02H,04H,0E0H,40H,84H,0FEH,00H,00H,00H,00H,00H,00H

DB 00H、78H、4FH、54H、58H、63H、50H、48H、4FH、48H、68H、50H、41H、41H、42H、4CH

DB 80H,40H,0FEH,02H,14H,0F8H,00H,08H,0FCH,0A0H,0A0H,0A0H,0A0H,22H,22H,1EH,00H

DB 06H,0F8H,11H,11H,0FFH,39H,55H,91H,11H,0FEH,24H,44H,28H,11H,2AH,44H

DB 40H,84H,0FEH,24H,24H,0FCH,24H,44H,0FCH,40H,60H,0A0H,0A8H,22H,22H,1EH

DB 01H,01H,01H,0FFH,01H,01H,3FH,00H,02H,11H,50H,50H,90H,0FH,00H

DB 00H,00H,04H,0FEH,00H,00H,10H,0F8H,00H,00H,80H,84H,12H,12H,0F0H,00H

DB 82H,44H,29H,0FEH,10H,11H,7CH,10H,10H,0FEH,11H,12H,10H,20H,21H,40H

DB 00H,04H,0DEH,44H,44H,54H,0CCH,44H,44H,0CCH,54H,64H,44H,44H,54H,88H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,30H,1EH,0FH,07H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 01H,01H,7FH,01H,05H,09H,31H,0C1H,0FH,00H,01H,7FH,01H,01H,05H,02H

DB 00H,08H,0FCH,00H,40H,30H,0EH,04H,0E0H,40H,88H,0FCH,00H,00H,00H,00H,00H

DB 08H,08H,08H,08H,0FEH,08H,18H,1CH,2AH,28H,49H,8AH,08H,08H,08H,08H,08H

24H,0FEH,20H,60H,70H,0A8H,0AEH,24H,20H,20H,20H,20H,20H

DB 00H,7FH,40H,40H,5FH,40H,40H,4FH,48H,48H,4FH,48H,40H,40H

DB 04H,0FEH,04H,24H,0F4H,04H,24H,0F4H,24H,24H,24H,24H,0E4H,24H,14H,08H

DB 22H,11H,11H,00H,7FH,40H,80H,1FH,00H,01H,0FFH,01H,01H,01H,01H,05H,02H

DB 08H,08H,10H,20H,0FEH,02H,04H,0E0H,40H,84H,0FEH,00H,00H,00H,00H,00H,00H

DB 10H,10H,22H,7FH,42H,43H,42H,42H,7EH,42H,42H,42H,42H,42H,7EH,42H,00H

DB 40H、40H、44H、7EH、84H、04H、04H、84H、64H、24H、04H、04H、04H、04H、28H、10H

DB 08H,08H,08H,17H,10H,30H,50H,90H,10H,10H,10H,10H,10H,10H,10H,10H,1FH,10H

DB 80H,40H,44H,0FEH,40H,40H,48H,0FCH,40H,40H,40H,40H,40H,44H,0FEH,00H

DB 02H,07H,38H,20H,20H,3EH,22H,22H,22H,3EH,22H,20H,21H,42H,84H,00H

DB 08H,1CH,0E0H,80H,80H,84H,0FEH,88H,88H,88H,88H,88H,08H,08H,08H,08H

DB 00H,01H,03H,03H,03H,03H,01H,01H,01H,00H,01H,00H,03H,01H,00H

00H,80H,0C0H,0C0H,0C0H,0C0H,80H,80H,80H,00H,80H,00H,00H,0C0H,80H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

表2:

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 01H,01H,02H,04H,08H,12H,21H,0C0H,00H,1FH,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,01H

db 00H,00H,80H,40H,20H,10H,8EH,84H,00H,0F0H,10H,20H,20H,40H,80H,00H

DB 00H,7FH,01H,01H,01H,01H,0FFH,01H,02H,02H,04H,04H,08H,10H,20H,0C0H

db 08H,0FCH,00H,00H,00H,04H,0FEH,00H,80H,80H,40H,40H,20H,10H,0EH,04H

00H,08H,7DH,4AH,4CH,4BH,4AH,7AH,4AH,4BH,4AH,48H,78H,49H,02H,04H

db 80H,80H,0F8H,10H,24H,0FEH,44H,44H,0FCH,64H,0A0H,0A2H,22H,1EH,00H

DB 01H、01H、01H、01H、01H、01H、01H、01H、01H、01H、01H、01H、01H、01H

db 00H,00H,00H,00H,10H,0F8H,00H,00H,00H,00H,00H,00H,00H,00H,00H,04H,0FEH,00H

DB 02H,02H,0FFH,04H,04H,0FH,08H,18H,2FH,48H,88H,0FH,08H,08H,08H,08H,08H

db 00H,04H,0FEH,00H,10H,0F8H,10H,0F0H,10H,10H,0F0H,10H,10H,10H,10H,50H,20H

DB 01H,01H,01H,01H,01H,7DH,05H,05H,09H,09H,1H,21H,41H,81H,05H,02H

db 00H,00H,00H,08H,18H,20H,0C0H,80H,40H,20H,10H,0EH,04H,00H,00H,00H

DB 00H,7CH,44H,49H,48H,50H,48H,4BH,44H,45H,45H,69H,51H,41H,41H,41H,41H

db 20H,20H,28H,0FCH,20H,20H,24H,0FEH,20H,24H,24H,24H,24H,24H,0FCH,04H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,60H,20H,20H,40H

DB 08H,0BH,12H,12H,23H,4AH,8AH,13H,32H,52H,92H,12H,12H,12H,12H,13H,13H,12H

db 08H,0FCH,08H,08H,0F8H,08H,0F8H,84H,8CH,50H,20H,10H,88H,0EH,04H

DB 00H,1FH,10H,10H,1FH,10H,10H,1FH,14H,44H,34H,14H,04H,04H,0FFH,00H

db 10H,0F8H,10H,10H,0F0H,10H,10H,0F0H,50H,44H,4CH,50H,40H,44H,0FEH,00H

DB 10H,10H,10H,1EH,22H,33H,4AH,0A4H,14H,08H,11H,22H,40H,24H 24H,40H

db 20H,20H,28H,24H,20H,0FEH,20H,50H,50H,88H,0EH,04H,00H,48H,46H,02H

DB 04H,0EH,78H,08H,08H,0FFH,08H,08H,0AH,0CH,18H,68H,09H,0AH,28H,10H

db 80H,0A0H,90H,90H,84H,0FEH,80H,90H,90H,60H,40H,0A0H,20H,14H,14H,0CH

DB 10H,12H,11H,24H,24H,64H,0A4H,24H,24H,24H,24H,24H,24H,24H,24H,24H

db 00H,04H,7EH,84H,04H,04H,04H,04H,04H,04H,04H,04H,04H,04H,04H,14H,08H

DB 00H,7FH,10H,10H,10H,08H,08H,04H,02H,01H,02H,04H,08H,30H,0C0H

db 00H,0F0H,10H,10H,20H,20H,40H,40H,80H,80H,00H,80H,40H,30H,0EH,04H

DB 10H,10H,10H,13H,0FCH,10H,14H,18H,30H,0D0H,10H,10H,10H,10H,10H,50H,20H

db 00H,00H,04H,0FEH,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,0A0H,40H

DB 00H,0FFH,00H,00H,01H,01H,03H,05H,09H,1H,21H,41H,01H,01H,01H,01H,01H,01H,01H

db 04H,0FEH,80H,80H,00H,00H,40H,20H,18H,0CH,04H,00H,00H,00H,00H,00H,00H

DB 00H,40H,20H,17H,00H,00H,0f 10H,10H,10H,10H,10H,10H,10H,10H,28H,47H,00H

db 10H,10H,10H,0FCH,10H,10H,90H,90H,10H,10H,10H,50H,20H,06H,0FCH,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H

结束