全新论坛MCU智学网上线,欢迎访问新论坛!稀缺资源、技术干货、参考设计、原厂资料尽在MCU智学网
更新自动建库工具PCB Footprint Expert 2024.04 Pro / Library Expert 破解版

LED点阵显示(汇编程序+图片)

[复制链接]
6445 1

本文包含原理图、PCB、源代码、封装库、中英文PDF等资源

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
;-------------------------------
;名字:全屏显示:西华大学
;日期:2008年12月13日
;
;----------数据串输出子程序-----
;-----定义P1.0为移位时钟
;-----定义P1.1为锁存时钟
;-----定义P1.2为红色显示串行输出数据
;-----定义P1.3为绿色显示串行输出数据
;---R3 定义为字符编码相对地址
;--R2 为行 相对地址
;----R1为一字符的第几位
CP EQU P1.0
SCK EQU P1.1
Red EQU P1.2
Greed EQU P1.3
Gen1 EQU P1.4
Gen2 EQU P3.5
A1 EQU P1.5
B1 EQU P1.6
C1 EQU P1.7
G1 EQU P3.7

;--------------------------------
ORG 0000H
AJMP START
ORG 0100H
START:
MOV SP,#70H ;初始指针为70H
MOV A, #00H
SETB Gen1
CLR Gen2
CLR G1 ;G2B之高,选择上半屏
SETB Red
SETB Greed
MOV R3,#00
MOV 40H,#00H
MOV 41H,#00H
MOV 42H,#00H ;换半屏比较位
MOV 43H,#00H ;换屏比较位


MAIN:
ACALL SendData
AJMP MAIN
SendData:

ACALL Sendhang
INC 40H
INC 40H
INC 40H
INC 40H
MOV A,40H
CJNE A,#128,L2
MOV 40H,#00H
L2: RET

Sendhang:
MOV DPTR,#CHANL1
MOV A,40H
MOVC A,@A+DPTR
ACALL SendByte

MOV DPTR,#CHANL1
MOV A,40H
INC A
MOVC A,@A+DPTR
ACALL SendByte


MOV DPTR,#CHANL1
MOV A,40H
INC A
INC A
MOVC A,@A+DPTR
ACALL SendByte

MOV DPTR,#CHANL1
MOV A,40H
INC A
INC A
INC A
MOVC A,@A+DPTR
ACALL SendByte



MOV DPTR,#CHANL2
MOV A,40H
MOVC A,@A+DPTR
ACALL SendByte

MOV DPTR,#CHANL2
MOV A,40H
INC A
MOVC A,@A+DPTR
ACALL SendByte

MOV DPTR,#CHANL2
MOV A,40H
INC A
INC A
MOVC A,@A+DPTR
ACALL SendByte

MOV DPTR,#CHANL2
MOV A,40H
INC A
INC A
INC A
MOVC A,@A+DPTR
ACALL SendByte
;-------------------------------------
MOV DPTR,#CHANL3
MOV A,40H
MOVC A,@A+DPTR
ACALL SendByte

MOV DPTR,#CHANL3
MOV A,40H
INC A
MOVC A,@A+DPTR
ACALL SendByte

MOV DPTR,#CHANL3
MOV A,40H
INC A
INC A
MOVC A,@A+DPTR
ACALL SendByte

MOV DPTR,#CHANL3
MOV A,40H
INC A
INC A
INC A
MOVC A,@A+DPTR
ACALL SendByte


MOV DPTR,#CHANL4
MOV A,40H
MOVC A,@A+DPTR
ACALL SendByte

MOV DPTR,#CHANL4
MOV A,40H
INC A
MOVC A,@A+DPTR
ACALL SendByte

MOV DPTR,#CHANL4
MOV A,40H
INC A
INC A
MOVC A,@A+DPTR
ACALL SendByte

MOV DPTR,#CHANL4
MOV A,40H
INC A
INC A
INC A
MOVC A,@A+DPTR
ACALL SendByte
;---------------------------------------
CLR SCK ;锁存数据
NOP
SETB SCK
ACALL SCAN
RET

SendByte:
MOV R1,#08H
CPL A
L1:

CLR CP
RLC A
MOV Red,C
MOV Greed,C
SETB CP
DJNZ R1,L1
RET

;--------------------------------
;换屏------------------------------
Huanping:
INC 43H
MOV A,43H
CJNE A,#02H,HP1
CPL Gen1
CPL Gen2
MOV 43H,#00
HP1:RET

;----串行点阵行扫描子程序 ---------
;----P1.4位行扫描时能引脚G2B ,低电平有效
;----P1.5为行扫描编码地址A
;----P1.6为行扫描编码地址B
;----P1.7为行扫描编码地址C
;----P3.7为行扫描使能引脚G1,高电平有效
;---------------------------------------------
SCAN:
MOV A,42H
CJNE A,#08,HANGOUT;扫描8行后 ,对扫描使能信号G1去反
MOV 42H,#00H
CPL G1
ACALL Huanping
HANGOUT:
MOV A,42H
RL A
RL A
RL A
RL A
RL A

ANL P1,#1FH
ORL P1,A
NOP
ACALL DELAY
INC 42H
RET
;---------------------------------
;------延时子程序 ----------------
DELAY:
SETB RS1
MOV R5, #5
L4:
MOV R4,#2
L3:
MOV R3,#2
DJNZ R3,$
DJNZ R4,L3
DJNZ R5,L4
CLR RS1
RET
CHANL1:
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 00FH, 080H;
DB 000H, 001H, 0FFH, 0C0H;
DB 000H, 07FH, 0FFH, 0C0H;
DB 000H, 07FH, 0FFH, 000H;
DB 000H, 03CH, 01CH, 000H;
DB 000H, 006H, 01CH, 000H;
DB 000H, 007H, 09CH, 000H;
DB 000H, 003H, 0BFH, 0F8H;
DB 000H, 007H, 0F8H, 03FH;
DB 000H, 07FH, 030H, 01FH;
DB 003H, 0E3H, 038H, 01EH;
DB 003H, 083H, 01FH, 01EH;
DB 003H, 087H, 01FH, 01EH;
DB 001H, 09EH, 00CH, 01EH;
DB 001H, 080H, 000H, 03CH;
DB 000H, 0C1H, 0FEH, 03CH;
DB 000H, 0FFH, 0FEH, 03CH;
DB 000H, 07FH, 0FEH, 078H;
DB 000H, 01CH, 003H, 0F0H;
DB 000H, 000H, 001H, 0F0H;
DB 000H, 000H, 000H, 060H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;"西"0
CHANL2:

DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 00CH, 000H;
DB 000H, 003H, 00EH, 000H;
DB 000H, 003H, 08EH, 000H;
DB 000H, 007H, 00EH, 0E0H;
DB 000H, 006H, 00DH, 0F0H;
DB 000H, 00CH, 00FH, 080H;
DB 000H, 01CH, 00FH, 000H;
DB 000H, 01EH, 01CH, 000H;
DB 000H, 03EH, 07CH, 008H;
DB 000H, 076H, 00CH, 018H;
DB 000H, 0C6H, 00CH, 018H;
DB 000H, 006H, 007H, 0FCH;
DB 000H, 006H, 007H, 0F8H;
DB 000H, 006H, 020H, 000H;
DB 000H, 000H, 038H, 000H;
DB 000H, 000H, 07FH, 0FFH;
DB 000H, 03FH, 0FFH, 0FFH;
DB 007H, 0FFH, 0F8H, 000H;
DB 00FH, 000H, 030H, 000H;
DB 000H, 000H, 030H, 000H;
DB 000H, 000H, 030H, 000H;
DB 000H, 000H, 030H, 000H;
DB 000H, 000H, 030H, 000H;
DB 000H, 000H, 030H, 000H;
DB 000H, 000H, 030H, 000H;
DB 000H, 000H, 030H, 000H;
DB 000H, 000H, 030H, 000H;
DB 000H, 000H, 030H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;"华"1
CHANL3:
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 070H, 000H;
DB 000H, 000H, 070H, 000H;
DB 000H, 000H, 070H, 000H;
DB 000H, 000H, 060H, 000H;
DB 000H, 000H, 060H, 000H;
DB 000H, 000H, 060H, 000H;
DB 000H, 000H, 060H, 000H;
DB 000H, 000H, 060H, 080H;
DB 000H, 000H, 0E7H, 080H;
DB 000H, 000H, 0FFH, 080H;
DB 000H, 003H, 0FFH, 080H;
DB 000H, 07FH, 0FCH, 000H;
DB 000H, 07FH, 0F8H, 000H;
DB 000H, 07FH, 0E0H, 000H;
DB 000H, 031H, 0F0H, 000H;
DB 000H, 001H, 0F8H, 000H;
DB 000H, 003H, 0FCH, 000H;
DB 000H, 003H, 01FH, 000H;
DB 000H, 007H, 007H, 080H;
DB 000H, 00EH, 001H, 0C0H;
DB 000H, 01CH, 000H, 0F8H;
DB 000H, 078H, 000H, 07FH;
DB 003H, 0E0H, 000H, 07FH;
DB 00FH, 0C0H, 000H, 07FH;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;"大"2
CHANL4:
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 080H;
DB 000H, 000H, 061H, 0C0H;
DB 000H, 001H, 0E3H, 0C0H;
DB 000H, 030H, 0C3H, 000H;
DB 000H, 038H, 006H, 000H;
DB 000H, 03CH, 00CH, 000H;
DB 000H, 000H, 01FH, 080H;
DB 000H, 001H, 0FFH, 070H;
DB 000H, 007H, 0E0H, 008H;
DB 000H, 07EH, 000H, 00EH;
DB 000H, 000H, 03EH, 01FH;
DB 003H, 001H, 0E7H, 0FEH;
DB 00FH, 00FH, 0C7H, 000H;
DB 00FH, 00EH, 018H, 000H;
DB 000H, 000H, 038H, 000H;
DB 000H, 000H, 03FH, 0F8H;
DB 000H, 000H, 0FFH, 0FCH;
DB 000H, 00FH, 0FCH, 004H;
DB 000H, 07FH, 0F8H, 000H;
DB 000H, 0E0H, 018H, 000H;
DB 000H, 000H, 018H, 000H;
DB 000H, 000H, 018H, 000H;
DB 000H, 000H, 038H, 000H;
DB 000H, 000H, 038H, 000H;
DB 000H, 000H, 038H, 000H;
DB 000H, 007H, 0F0H, 000H;
DB 000H, 000H, 070H, 000H;
DB 000H, 000H, 000H, 000H;
DB 000H, 000H, 000H, 000H;"学"3
END


5_25705_19e57cc262d4d66.jpg 5_25705_f6e33ade886e370.jpg 5_25705_5d97aa60c4c679d.jpg 5_25705_cd2f806440cd2aa.jpg 5_25705_655339c8df39a10.jpg

举报

回复

1 个评论

远方***  新手上路  发表于 2012-12-29 16:52:00  | 显示全部楼层
有没有详细资料
*滑块验证:
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

打开支付宝扫一扫,最高立得1212元红包
搜索

图文热点

更多

社区学堂

更多

客服中心

QQ:187196467 服务时间:周一至周日 8:30-20:30

关注我们

关于我们
关于我们
友情链接
联系我们
帮助中心
网友中心
购买须知
支付方式
服务支持
资源下载
售后服务
定制流程
关注我们
官方微博
官方空间
官方微信
快速回复 返回顶部 返回列表