12864 汉字显示演示程序.docx
- 文档编号:24728735
- 上传时间:2023-06-01
- 格式:DOCX
- 页数:39
- 大小:63.36KB
12864 汉字显示演示程序.docx
《12864 汉字显示演示程序.docx》由会员分享,可在线阅读,更多相关《12864 汉字显示演示程序.docx(39页珍藏版)》请在冰豆网上搜索。
12864汉字显示演示程序
;12864(带字库汉字显示演示程序)
;***************************************************************************
;*sxj1974@(51c51testweb)*
;*Createby:
石学军更多例程请登陆网站*
;***************************************************************************
RSEQUP2.0
RWEQUP2.1
EEQUP2.2
PSBEQUP2.3
RSTEQUP2.5
;-----------------------------------------------
LCD_XEQU30H
LCD_YEQU31H
COUNTEQU32H
COUNT1EQU33H
COUNT2EQU34H
COUNT3EQU35H
;-----------------------------------------------
LCD_DATAEQU36H
LCD_DATA1EQU37H
LCD_DATA2EQU38H
STOREEQU39H
;-----------------------------------------------
ORG0000H
LJMPMAIN
ORG0100H
;-----------------------------------------------
MAIN:
MOVSP,#5FH
CLRRST;复位
LCALLDELAY4
SETBRST
NOP
SETBPSB;通讯方式为8位数据并口
;********************初始化**********************
LGS0:
MOVA,#34H;34H--扩充指令操作
LCALLSEND_I
MOVA,#30H;30H--基本指令操作
LCALLSEND_I
MOVA,#01H;清除显示
LCALLSEND_I
MOVA,#06H;指定在资料写入或读取时,光标的移动方向
LCALLSEND_I;DDRAM的地址计数器(AC)加1
MOVA,#0CH;开显示,关光标,不闪烁
LCALLSEND_I
;===============================================
TU_PLAY1:
MOVDPTR,#TU_TAB1;显示图形
LCALLPHO_DISP
LCALLDELAY3
;=================================================
;;显示汉字和字符
;加入80ms的延时,使你能够看清楚显示的过程
;根据汉字显示坐标分段写入(顺序写入)
;=================================================
HAN_WR2:
LCALLCLEAR_P
HAN_WR2A:
MOVDPTR,#TAB1A;显示汉字和字符
MOVCOUNT,#10H;地址计数器设为16。
MOVA,#80H;第一行起始地址
LCALLSEND_I
LCALLQUSHU
HAN_WR2B:
MOVDPTR,#TAB1B;显示汉字和字符
MOVCOUNT,#10H;地址计数器设为16。
MOVA,#90H;第二行起始地址
LCALLSEND_I
LCALLQUSHU
HAN_WR2C:
MOVDPTR,#TAB1C;显示汉字和字符
MOVCOUNT,#10H;地址计数器设为16。
MOVA,#88H;第三行起始地址
LCALLSEND_I
LCALLQUSHU
HAN_WR2D:
MOVDPTR,#TAB1D;显示汉字和字符
MOVCOUNT,#10H;地址计数器设为16。
MOVA,#98H;第四行起始地址
LCALLSEND_I
LCALLQUSHU
LCALLDELAY3
LCALLFLASH
LCALLCLEAR_P
JMPTU_PLAY2
;----------------------------------------------
;TU_PLAY1:
MOVDPTR,#TU_TAB1;显示图形
LCALLPHO_DISP
LCALLDELAY3
;----------------------------------------------
TU_PLAY2:
MOVDPTR,#TU_TAB2;显示图形
LCALLPHO_DISP
LCALLDELAY3
;----------------------------------------------
TU_PLAY3:
MOVDPTR,#TU_TAB4;显示图形
LCALLPHO_DISP
LCALLDELAY3
;-----------------------------------------------
;显示点阵
;-----------------------------------------------
LATPLAY1:
MOVA,#01H;清屏
LCALLSEND_I
MOVLCD_DATA1,#0CCH;显示点阵
MOVLCD_DATA2,#0CCH
LCALLLAT_DISP
LCALLDELAY3
LCALLCLEAR_P
KU_PLAY2:
LJMPTU_PLAY1
;===============================================
;全屏显示图形子程序
;===============================================
PHO_DISP:
MOVCOUNT3,#02H
MOVLCD_X,#80H
PHO_DISP1:
MOVLCD_Y,#80H
MOVCOUNT2,#20H
PHO_DISP2:
MOVCOUNT1,#10H
LCALLWR_ZB
PHO_DISP3:
CLRA
MOVCA,@A+DPTR
LCALLSEND_D
INCDPTR
DJNZCOUNT1,PHO_DISP3
INCLCD_Y
DJNZCOUNT2,PHO_DISP2
MOVLCD_X,#88H
DJNZCOUNT3,PHO_DISP1
MOVA,#36H
LCALLSEND_I
MOVA,#30H
LCALLSEND_I
RET
;----------------------------------------------
CLRRAM:
MOVLCD_DATA1,#00H;GDRAM写0子程序
MOVLCD_DATA2,#00H
LCALLLAT_DISP
RET
;==============================================
;显示点阵子程序
;==============================================
LAT_DISP:
MOVCOUNT3,#02H
MOVLCD_X,#80H
LAT_DISP1:
MOVLCD_Y,#80H
CLRF0
MOVCOUNT2,#20H
LAT_DISP2:
MOVCOUNT1,#10H
LCALLWR_ZB
LAT_DISP3:
JBF0,LAT_DISP32
MOVLCD_DATA,LCD_DATA1
AJMPLAT_DISP31
LAT_DISP32:
MOVLCD_DATA,LCD_DATA2
LAT_DISP31:
MOVA,LCD_DATA
LCALLSEND_D
DJNZCOUNT1,LAT_DISP31
INCLCD_Y
CPLF0
DJNZCOUNT2,LAT_DISP2
MOVLCD_X,#88H
DJNZCOUNT3,LAT_DISP1
MOVA,#36H
LCALLSEND_I
MOVA,#30H
LCALLSEND_I
RET
;---------------------------------------------
WR_ZB:
MOVA,#34H
LCALLSEND_I
MOVA,LCD_Y
LCALLSEND_I
MOVA,LCD_X
LCALLSEND_I
MOVA,#30H
LCALLSEND_I
RET
;===============================================
FLASH:
MOVA,#08H;关闭显示
LCALLSEND_I
LCALLDELAY5
MOVA,#0CH;开显示,关光标,不闪烁
LCALLSEND_I
LCALLDELAY5
MOVA,#08H;关闭显示
LCALLSEND_I
LCALLDELAY5
MOVA,#0CH;开显示,关光标,不闪烁
LCALLSEND_I
LCALLDELAY5
MOVA,#08H;关闭显示
LCALLSEND_I
LCALLDELAY5
RET
;==================================================
;清屏
;==================================================
CLEAR_P:
MOVA,#01H;清屏
LCALLSEND_I
MOVA,#34H
LCALLSEND_I
MOVA,#30H
LCALLSEND_I
RET
;==================================================
;查表取数据送显示
;==================================================
QUSHU:
CLRA
MOVCA,@A+DPTR;查表取数据
LCALLSEND_D;送显示
INCDPTR
LCALLDELAY4;延时80ms,
DJNZCOUNT,QUSHU
RET
;===============================================
;写数据子程序
;RS=1,RW=0,E=高脉冲,D0-D7=数据
;===============================================
SEND_D:
LCALLCHK_BUSY;写数据子程序
SETBRS
CLRRW
MOVP0,A
SETBE
NOP
NOP
CLRE
RET
;===============================================
;写指令子程序
;RS=0,RW=0,E=高脉冲,D0-D7=指令码
;===============================================
SEND_I:
LCALLCHK_BUSY
CLRRS
CLRRW
MOVP0,A
SETBE
NOP
NOP
CLRE
RET
;================================================
;读数据子程序
;RS=1,RW=1,E=H,D0-D7=数据
;================================================
READ_D:
LCALLCHK_BUSY;读数据子程序
SETBRS
SETBRW
SETBE
NOP
MOVA,P0
CLRE
MOVSTORE,A
RET
;================================================
;;测忙碌子程序
;RS=0,RW=1,E=H,D0-D7=状态字
;================================================
CHK_BUSY:
MOVP0,#0FFH;测忙碌子程序
CLRRS
SETBRW
SETBE
JBP0.7,$
CLRE
RET
;================================================
;延时子程序
DELAY3:
MOVR5,#16H
DEL31:
MOVR6,#100
DEL32:
MOVR7,#0FFH
DEL33:
DJNZR7,DEL33
DJNZR6,DEL32
DJNZR5,DEL31
RET
DELAY2:
MOVR6,#0CH
DEL21:
MOVR7,#18H
DEL22:
DJNZR7,DEL22
DJNZR6,DEL21
RET
DELAY1:
MOVR6,#06H
DEL11:
MOVR7,#08H
DEL12:
DJNZR7,DEL12
DJNZR6,DEL11
RET
DELAY4:
MOVR6,#100
DEL41:
MOVR7,#200
DEL42:
DJNZR7,DEL42
DJNZR6,DEL41
RET
DELAY5:
MOVR5,#05H
DEL51:
MOVR6,#100
DEL52:
MOVR7,#0FFH
DEL53:
DJNZR7,DEL53
DJNZR6,DEL52
DJNZR5,DEL51
RET
;***********************************************
TAB1:
TAB1A:
DB'51单片机学习网(深圳学林电子有限公司)';显示在第一行
TAB1C:
DB'自学单片机第一站';显示在第三行
TAB1B:
DB'WWW.8951.COM';显示在第二行
TAB1D:
DB'TEL755-89956892';显示在第四行
;*--------------------------------------------------------------------*
;*Bitmap点阵数据表*
;*图片:
E:
\图形8.bmp,横向取模左高位,数据排列:
从左到右从上到下*
;*图片尺寸:
128*64*
;*--------------------------------------------------------------------*
TU_TAB1:
;数据表
db0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
db80h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,00h,00h,00h,3Ch,00h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,00h,00h,00h,7Fh,00h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,00h,00h,00h,0FFh,0C0h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,00h,00h,01h,0BFh,0F8h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,00h,00h,01h,0FFh,0DCh,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,00h,00h,01h,1Fh,0FEh,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,00h,00h,01h,0DFh,0FFh,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,00h,00h,00h,0FFh,0FFh,19h,8Ch,03h,06h,00h,18h,00h,0FFh,0E1h
db80h,00h,00h,00h,00h,3Fh,0FFh,0Ch,0CCh,03h,06h,00h,18h,00h,0FFh,0E1h
db80h,00h,00h,00h,00h,7Fh,0FFh,04h,58h,03h,06h,01h,0FFh,0C0h,00h,0C1h
db80h,00h,00h,00h,00h,7Fh,0DAh,3Fh,0FEh,0Fh,0DFh,0C1h,0FFh,0C0h,01h,81h
db80h,00h,00h,00h,00h,7Fh,8Ch,3Fh,0FEh,0Fh,0DFh,0C1h,98h,0C0h,07h,01h
db80h,00h,00h,00h,00h,7Fh,0B8h,30h,06h,03h,06h,01h,98h,0C0h,06h,01h
db80h,00h,00h,00h,00h,0FEh,0C0h,0Fh,0F8h,03h,8Eh,01h,0FFh,0C3h,0FFh,0F9h
db80h,00h,00h,00h,00h,7Eh,00h,0Fh,0F8h,07h,0CFh,01h,98h,0C3h,0FFh,0F9h
db80h,00h,00h,00h,00h,7Fh,00h,00h,60h,07h,5Fh,81h,98h,0C0h,06h,01h
db80h,00h,00h,00h,00h,7Fh,80h,3Fh,0FEh,0Fh,36h,0C1h,0FFh,0C0h,06h,01h
db80h,00h,00h,00h,00h,1Fh,80h,0BFh,0FEh,0Bh,36h,61h,0FFh,0C0h,06h,01h
db80h,00h,00h,00h,00h,1Fh,0C7h,00h,0C0h,03h,66h,21h,98h,30h,06h,01h
db80h,00h,00h,00h,15h,5Fh,0C7h,00h,0C0h,03h,06h,00h,18h,30h,06h,01h
db80h,00h,02h,0E0h,06h,7Fh,0CEh,03h,0C0h,03h,06h,00h,1Fh,0F0h,1Eh,01h
db80h,00h,04h,54h,4Fh,0FFh,0FCh,01h,80h,03h,06h,00h,0Fh,0E0h,0Ch,01h
db80h,00h,03h,0FDh,3Fh,0FFh,0D9h,0C0h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,1Dh,0FFh,0FFh,0FFh,87h,80h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,2Bh,0FFh,0F8h,7Fh,06h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,3Fh,0BFh,0F8h,09h,0Fh,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,1Fh,9Fh,0F0h,00h,0BCh,00h,00h,00h,00h,00h,00h,00h,00h,01h
db9Dh,0FEh,1Fh,8Fh,0F0h,00h,0F8h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db9Fh,0FCh,17h,8Fh,0F0h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db81h,0FFh,0CFh,9Fh,0E0h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db82h,0FFh,0FFh,9Ch,80h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db81h,7Fh,0FFh,0FCh,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,6Fh,0FEh,30h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,03h,0FCh,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,01h
db80h,00h,34h,14h,00h,00h,00h,00h,00h,00h,00h,00h
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 12864 汉字显示演示程序 汉字 显示 演示 程序
![提示](https://static.bdocx.com/images/bang_tan.gif)