51单片机实现的多图显示用12864液晶驱动程序方案设计书Word文档格式.docx
《51单片机实现的多图显示用12864液晶驱动程序方案设计书Word文档格式.docx》由会员分享,可在线阅读,更多相关《51单片机实现的多图显示用12864液晶驱动程序方案设计书Word文档格式.docx(68页珍藏版)》请在冰豆网上搜索。
![51单片机实现的多图显示用12864液晶驱动程序方案设计书Word文档格式.docx](https://file1.bdocx.com/fileroot1/2022-11/27/62304908-df65-4479-a2cf-b1468285dc88/62304908-df65-4479-a2cf-b1468285dc881.gif)
FM12864、TS12864A-2或兼容型号(不带字库)
MCU:
AT89S5*,晶体频率:
11.0592MHz
取模方式:
纵向取模、字节倒序
CS1和CS2为高电平有效
************************************************/
;
***************硬件端口定义***********
RSEQUP2.0
RWEQUP2.1
EEQUP2.2
CS1EQUP2.3
CS2EQUP2.4
RSTEQUP2.5
COMEQU20H;
指令数据寄存器
DATEQU21H;
显示数据寄存器
**********************************主程序入口地址
ORG0000H
AJMPSTR
ORG0003H
*********************************中断程序入口地址
STR:
AJMPL0100
L0100:
CLRRST
NOP
SETBRST
********************************以上是软件复位
MOVSP,#60H
MOVIE,#81H;
中断允许
MOVIP,#01H;
优先中断
MOVTCON,#00H;
电平中断
MOVCOM,#3FH;
显示开
LCALLS02A9;
左半屏写指令子程序
LCALLS02C1;
右半屏写指令子程序
----------------------------------------------------------------------
MOVCOM,#0C0H;
第一行
MOVCOM,#0B8H;
第一页
MOVCOM,#40H;
第一列
********************************************************以上是软件初始化
MOVB,#0AAH
LCALLXIHX;
显示横线1
LCALLDELAY
;
MOVB,#55H
LCALLXIHX
LCALLDELAY;
显示横线2
MOVB,#0FFH
MOV29H,#00H
LCALLXISX
显示竖线1
MOVB,#00H
MOV29H,#0FFH
显示竖线2
MOVDPTR,#TAB1
LCALLLEFT
MOVDPTR,#TAB2
LCALLRIGHT
显示第一幅图片
MOVDPTR,#TAB3
MOVDPTR,#TAB4
显示第二幅图片
MOVDPTR,#TAB5
MOVDPTR,#TAB6
显示第三幅图片
=======================================================以上是主程序
LEFT:
MOVR1,#0B8H
_AB:
MOVCOM,R1;
左半屏写指令子程序
MOVR0,#64
S027B:
MOVA,#00H
MOVCA,@A+DPTR
MOVDAT,A
LCALLS02B1;
左半屏写数据子程序
INCDPTR
DJNZR0,S027B
INCR1
CJNER1,#0C0H,_AB
RET
======================================================以上是左半屏写数据子程序
RIGHT:
ABC:
右半屏写指令子程序
S027D:
LCALLS02B9;
右半屏写数据子程序
DJNZR0,S027D
CJNER1,#0C0H,ABC
*******************************************************以上是右半屏写数据子程序
XIHX:
MOVR1,#0B8H
BA:
W027B:
MOVDAT,B
DJNZR0,W027B
CJNER1,#0C0H,BA
---------------------------------------------------------
XISX:
CA:
MOVR0,#32
X027B:
MOVDAT,29H
右半屏写数据子程序
DJNZR0,X027B
CJNER1,#0C0H,CA
RET
****************************************************以上是显示线条程序
S02A9:
SETBCS1
LCALLS02C9
CLRCS1;
S02B1:
SETBCS1;
LCALLS02E0
CLRCS1
S02C1:
SETBCS2;
LCALLS02C9
CLRCS2
S02B9:
CLRCS2
****************************************************
S02C9:
CLRRS
SETBRW
S02C9A:
MOVP0,#0FFH
SETBE
MOVA,P0
CLRE
JBACC.7,S02C9A
CLRRW
MOVP0,COM
*************************************************以上是写指令子程序
S02E0:
S02E0A:
JBACC.7,S02E0A
SETBRS
MOVP0,DAT
************************************************以上是写数据子程序
DELAY:
MOVR5,#0BH;
延时
D1:
MOVR7,#0FFH
D2:
MOVR6,#0FFH
D3:
DJNZR6,$
DJNZR7,D2
DJNZR5,D1
****************************************************************
TAB1:
--调入了一幅图像:
C\128x64-1.bmp--
--宽度x高度=64x64--
DB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H
DB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,080H,080H,0C0H,0C0H
DB0E0H,0E0H,0E0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F8H,0F8H,0F8H,0F8H,0F8H,0F8H,0F8H,0F8H
DB0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,0FCH,07CH,078H,078H,038H,038H,030H
DB000H,000H,000H,000H,000H,000H,000H,0E0H,0F0H,0FCH,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH
DB0FFH,0FFH,0FFH,0FFH,0EFH,0CFH,0E7H,0E7H,0E7H,0F3H,073H,033H,03BH,019H,00DH,08DH
DB0CDH,0E7H,0F6H,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,07FH,03EH,01CH,000H
DB000H,0E0H,0E0H,0F0H,0F0H,0F0H,0F8H,0F9H,0FDH,0FDH,0FDH,0DFH,09FH,08EH,08FH,08FH
DB08FH,00FH,00FH,00FH,00FH,00FH,007H,003H,001H,060H,060H,06CH,06CH,06EH,06FH,067H
DB067H,0E7H,0F7H,0F7H,0F3H,0F3H,0F3H,0F3H,0F9H,0F9H,0F8H,0F8H,0FCH,0FCH,0FEH,0FEH
DB000H,001H,00FH,07FH,0FFH,0FFH,0FFH,0FFH,0FFH,07FH,01FH,00FH,007H,003H,003H,001H
DB081H,0E0H,0F0H,0F8H,0FCH,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,0FEH,0FEH,0FEH
DB0FEH,0FCH,0FCH,0FCH,0F8H,0F0H,061H,001H,001H,003H,003H,007H,0DFH,0FFH,0FFH,0FFH
DB000H,000H,000H,000H,001H,00FH,07FH,0FFH,0FFH,0E0H,0C0H,0C0H,080H,000H,000H,000H
DB003H,007H,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,00FH,007H
DB087H,087H,0C3H,0C3H,0C1H,0E0H,0F0H,0F0H,0F8H,0FCH,0FCH,0FFH,0FFH,0FFH,0FFH,0FFH
DB000H,000H,000H,000H,000H,000H,000H,001H,00FH,07FH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
DB0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,0FFH,0FFH,0FFH,0FFH
DB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,07FH,07FH,03FH,03FH,03FH,01FH,01FH,01FH,00FH
DB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,003H,00FH,07FH,0FFH,0FFH,0FFH
DB0FFH,07FH,07FH,03FH,03FH,03FH,01FH,01FH,01FH,00FH,00FH,00FH,007H,007H,003H,003H
DB003H,001H,001H,001H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H
TAB2:
C:
\128x64-2.bmp--
DB000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,080H,080H,080H,0C0H
DB0C0H,0C0H,0E0H,0E0H,0E0H,0F0H,0F0H,0F8H,0F8H,0F8H,0FCH,0FCH,0FCH,0FEH,0FEH,0FFH
DB0FFH,0FFH,0FFH,0FEH,0F8H,0C0H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H
DB030H,038H,078H,0F8H,0FCH,0FCH,0FCH,0FEH,0FEH,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
DB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
DB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,0F0H,0C0H,000H,000H,000H,000H,000H,000H,000H
DB000H,080H,0C0H,0F1H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
DB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,0F0H,080H,000H,000H,000H,000H
DB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,03FH,007H,001H,001H,001H,001H,001H
DB0E1H,0FDH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,01FH,007H,001H,001H,001H,0C1H,0C1H
DB001H,001H,001H,007H,01FH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,0F0H,080H,000H
DB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,03FH,007H,001H,000H,000H,000H,000H,0E0H,0F8H,0FFH
DB0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,03FH,007H,000H,000H,000H,000H,038H,03EH,03FH,0BFH
DB0BFH,0F8H,0C0H,0C0H,0E0H,0E0H,0E7H,0FFH,0FFH,09FH,01FH,00FH,00FH,007H,007H,000H
DB0FFH,0FFH,0FFH,0FFH,0EFH,0E1H,0E0H,0E0H,0E0H,0E0H,0E0H,0F8H,07FH,07FH,07FH,03FH
DB03FH,03FH,07FH,07FH,07FH,078H,07CH,07CH,07CH,07EH,00EH,007H,003H,003H,003H,003H
DB003H,003H,003H,00FH,03FH,07FH,07FH,07FH,07FH,07FH,07CH,070H,000H,000H,000H,000H
DB00FH,00FH,007H,007H,003H,003H,003H,001H,001H,001H,000H,000H,000H,000H,000H,000H
DB000H,000H,000H,000H,000H,000H,000H,0