原创 自带字库的点阵式液晶12864单片机控制程序

2009-4-11 12:38 2956 5 10 分类: 电源/新能源

一、概述


   带中文字库的128X64是一种具有4/8位并行、2线或3线串行多种接口方式,内部含有国标一级、二级简体中文字库的点阵图形液晶显示模块;其显示分辨率为128×64, 内置8192个16*16点汉字,和128个16*8点ASCII字符集.利用该模块灵活的接口方式和简单、方便的操作指令,可构成全中文人机交互图形界面。可以显示8×4行16×16点阵的汉字. 也可完成图形显示.低电压低功耗是其又一显著特点。由该模块构成的液晶显示方案与同类型的图形点阵液晶显示模块相比,不论硬件电路结构或显示程序都要简洁得多,且该模块的价格也略低于相同点阵的图形液晶模块。


基本特性:


l         低电源电压(VDD:+3.0--+5.5V)


l         显示分辨率:128×64点


l         内置汉字字库,提供8192个16×16点阵汉字(简繁体可选)


l         内置 128个16×8点阵字符


l         2MHZ时钟频率


l         显示方式:STN、半透、正显


l         驱动方式:1/32DUTY,1/5BIAS


l         视角方向:6点


l         背光方式:侧部高亮白色LED,功耗仅为普通LED的1/5—1/10


l         通讯方式:串行、并口可选


l         内置DC-DC转换电路,无需外加负压


l         无需片选信号,简化软件设计


l         工作温度: 0℃ - +55℃ ,存储温度: -20℃ - +60℃ 


 


模块接口说明



 



*注释1:如在实际应用中仅使用串口通讯模式,可将PSB接固定低电平,也可以将模块上的J8和“GND”用焊锡短接。


*注释2:模块内部接有上电复位电路,因此在不需要经常复位的场合可将该端悬空。


*注释3:如背光和模块共用一个电源,可以将模块上的JA、JK用焊锡短接。


2.2并行接口




管脚号


管脚名称


电平


管脚功能描述


1


VSS


0V


电源地


2


VCC


3.0+5V


电源正


3


V0


-


对比度(亮度)调整


4


RS(CS)


H/L


RS=“H”,表示DB7——DB0为显示数据


RS=“L”,表示DB7——DB0为显示指令数据


5


R/W(SID)


H/L


R/W=“H”,E=“H”,数据被读到DB7——DB0


R/W=“L”,E=“H→L”, DB7——DB0的数据被写到IR或DR


6


E(SCLK)


H/L


使能信号


7


DB0


H/L


三态数据线


8


DB1


H/L


三态数据线


9


DB2


H/L


三态数据线


10


DB3


H/L


三态数据线


11


DB4


H/L


三态数据线


12


DB5


H/L


三态数据线


13


DB6


H/L


三态数据线


14


DB7


H/L


三态数据线


15


PSB


H/L


H:8位或4位并口方式,L:串口方式(见注释1)


16


NC


-


空脚


17


/RESET


H/L


复位端,低电平有效(见注释2)


18


VOUT


-


LCD驱动电压输出端


19


A


VDD


背光源正端(+5V)(见注释3)


20


K


VSS


背光源负端(见注释3)


*注释1:如在实际应用中仅使用并口通讯模式,可将PSB接固定高电平,也可以将模块上的J8和“VCC”用焊锡短接。


*注释2:模块内部接有上电复位电路,因此在不需要经常复位的场合可将该端悬空。   


*注释3:如背光和模块共用一个电源,可以将模块上的JA、JK用焊锡短接。


.模块主要硬件构成说明


控制器接口信号说明:


1、RS,R/W的配合选择决定控制界面的4种模式:




RS


R/W


功能说明


L


L


MPU写指令到指令暂存器(IR)


L


H


读出忙标志(BF)及地址记数器(AC)的状态


H


L


MPU写入数据到数据暂存器(DR)


H


H


MPU从数据暂存器(DR)中读出数据


2、E信号




E状态


执行动作


结果


高——>低


I/O缓冲——>DR


配合/W进行写数据或指令



DR——>I/O缓冲


配合R进行读数据或指令


/低——>高


无动作

 
● 忙标志:BF    BF标志提供内部工作情况.BF=1表示模块在进行内部操作,此时模块不接受外部指令和数据.BF=0时,模块为准备状态,随时可接受外部指令和数据.     利用STATUS RD 指令,可以将BF读到DB7总线,从而检验模块之工作状态.●  字型产生ROM(CGROM)    字型产生ROM(CGROM)提供8192个此触发器是用于模块屏幕显示开和关的控制。DFF=1为开显示(DISPLAY ON),DDRAM 的内容就显示在屏幕上,DFF=0为关显示(DISPLAY OFF)。    DFF 的状态是指令DISPLAY ON/OFF和RST信号控制的。   显示数据RAM(DDRAM)模块内部显示数据RAM提供64×2个位元组的空间,最多可控制4行16字(64个字)的中文字型显示,当写入显示数据RAM时,可分别显示CGROM与CGRAM的字型;此模块可显示三种字型,分别是半角英数字型(16*8)、CGRAM字型及CGROM的中文字型,三种字型的选择,由在DDRAM中写入的编码选择,在0000H—0006H的编码中(其代码分别是0000、0002、0004、0006共4个)将选择CGRAM的自定义字型,02H—7FH的编码中将选择半角英数字的字型,至于A1以上的编码将自动的结合下一个位元组,组成两个位元组的编码形成中文字型的编码BIG5(A140—D75F),GB(A1A0-F7FFH)。   ●  字型产生RAM(CGRAM)    字型产生RAM提供图象定义(造字)功能, 可以提供四组16×16点的自定义图象空间,使用者可以将内部字型没有提供的图象字型自行定义到CGRAM中,便可和CGROM中的定义一样地通过DDRAM显示在屏幕中。●  地址计数器AC地址计数器是用来贮存DDRAM/CGRAM之一的地址,它可由设定指令暂存器来改变,之后只要读取或是写入DDRAM/CGRAM的值时,地址计数器的值就会自动加一,当RS为“0”时而R/W为“1”时,地址计数器的值会被读取到DB6——DB0中。

      光标/闪烁控制电路


    此模块提供硬体光标及闪烁控制电路,由地址计数器的值来指定DDRAM中的光标或闪烁位置。


五、指令说明


  模块控制芯片提供两套控制命令,基本指令和扩充指令如下:


指令表1:(RE=0:基本指令)





                  指 令 码


功 能



RS


R/W


D7


D6


D5


D4


D3


D2


D1


D0

 

清除


显示


0


0


0


0


0


0


0


0


0


1


DDRAM填满"20H",并且设定DDRAM的地址计数器(AC)到"00H"


地址


归位


0


0


0


0


0


0


0


0


1


X


设定DDRAM的地址计数器(AC)到"00H",并且将游标移到开头原点位置;这个指令不改变DDRAM 的内容


显示状态开/关


0


0


0


0


0


0


1


D


C


B


D=1: 整体显示 ON


C=1: 游标ON    


B=1:游标位置反白允许


进入点


设定


0


0


0


0


0


0


0


1


I/D


S


指定在数据的读取与写入时,设定游标的移动方向及指定显示的移位


游标或显示移位控制


0


0


0


0


0


1


S/C


R/L


X


X


设定游标的移动与显示的移位控制位;这个指令不改变DDRAM 的内容


 功能


 设定


0


0


0


0


1


DL


X


RE


X


X


DL=0/1:4/8位数据


RE=1: 扩充指令操作


RE=0: 基本指令操作


 设定CGRAM


 地址


0


0


0


1


AC5


AC4


AC3


AC2


AC1


AC0


设定CGRAM 地址


 设定DDRAM


 地址


0


0


1


0


AC5


AC4


AC3


AC2


AC1


AC0


设定DDRAM 地址(显示位址)


第一行:80H-87H


第二行:90H-97H


读取忙标志和地址


0


1


BF


AC6


AC5


AC4


AC3


AC2


AC1


AC0


读取忙标志(BF)可以确认内部动作是否完成,同时可以读出地址计数器(AC)的值


写数据到RAM


1


0


数据


将数据D7——D0写入到内部的RAM (DDRAM/CGRAM/IRAM/GRAM)


读出RAM的值


1


1


数据


从内部RAM读取数据D7——D0


(DDRAM/CGRAM/IRAM/GRAM)


指令表2:(RE=1:扩充指令)





                  指 令 码


功 能



RS


R/W


D7


D6


D5


D4


D3


D2


D1


D0

 

  待命


模式


0


0


0


0


0


0


0


0


0


1


进入待命模式,执行其他指令都棵终止


待命模式


卷动地址开关开启


0


0


0


0


0


0


0


0


1


SR


SR=1:允许输入垂直卷动地址


SR=0:允许输入IRAM和CGRAM地址


  反白


  选择


0


0


0


0


0


0


0


1


R1


R0


选择2行中的任一行作反白显示,并可决定反白与否。初始值R1R0=00,第一次设定为反白显示,再次设定变回正常


  睡眠


  模式


0


0


0


0


0


0


1


SL


X


X


SL=0:进入睡眠模式


SL=1:脱离睡眠模式


  扩充


  功能


  设定


0


0


0


0


1


CL


X


RE


G


0


CL=0/1:4/8位数据


RE=1: 扩充指令操作


RE=0: 基本指令操作


G=1/0:绘图开关


 设定绘图RAM


 地址


0


0


1


0


AC6


0


AC5


0


AC4


AC3


AC3


AC2


AC2


AC1


AC1


AC0


AC0


设定绘图RAM


先设定垂直(列)地址AC6AC5…AC0


再设定水平(行)地址AC3AC2AC1AC0


将以上16位地址连续写入即可


备注;当IC1在接受指令前,微处理器必须先确认其内部处于非忙碌状态,即读取BF标志时,BF需为零,方可接受新的指令;如果在送出一个指令前并不检查BF标志,那么在前一个指令和这个指令中间必须延长一段较长的时间,即是等待前一个指令确实执行完成。


应用举例:


1 、使用前的准备


   先给模块加上工作电压,再按照下图的连接方法调节LCD的对比度,使其显示出黑色的底影。


   此过程亦可以初步检测LCD有无缺段现象。


2、字符显示


带中文字库的128X64-0402B每屏可显示4行8列共32个16×16点阵的汉字,每个显示RAM可显示1个中


 


文字符或2个16×8点阵全高ASCII码字符,即每屏最多可实现32个中文字符或64个ASCII码字符的显示。带中文字库的128X64-0402B内部提供128×2字节的字符显示RAM缓冲区(DDRAM)。字符显示是通过将字符显示编码写入该字符显示RAM实现的。根据写入内容的不同,可分别在液晶屏上显示CGROM(中文字库)、HCGROM(ASCII码字库)及CGRAM(自定义字形)的内容。三种不同字符/字型的选择编码范围为:0000~0006H(其代码分别是0000、0002、0004、0006共4个)显示自定义字型,02H~7FH显示半宽ASCII码字符,A1A0H~F7FFH显示8192种GB2312中文字库字形。字符显示RAM在液晶模块中的地址80H~9FH。字符显示的RAM的地址与32个字符显示区域有着一一对应的关系,其对应关系如下表所示。




80H


81H


82H


83H


84H


85H


86H


87H


90H


91H


92H


93H


94H


95H


96H


97H


88H


89H


8AH


8BH


8CH


8DH


8EH


8FH


98H


99H


9AH


9BH


9CH


9DH


9EH


9FH


3 、图形显示  


先设垂直地址再设水平地址(连续写入两个字节的资料来完成垂直与水平的坐标地址)


垂直地址范围 AC5...AC0


水平地址范围 AC3…AC0


绘图RAM 的地址计数器(AC)只会对水平地址(X )自动加一,当水平地址=0FH 时会重新设为00H 但并不会对垂直地址做进位自动加一,故当连续写入多笔资料时,程序需自行判断垂直地址是否需重新设定。GDRAM的坐标地址与资料排列顺序如下图:


 


3、应用说明


带中文字库的128X64显示模块时应注意以下几点:


①欲在某一个位置显示中文字符时,应先设定显示字符位置,即先设定显示地址,再写入中文字符编码。


②显示ASCII字符过程与显示中文字符过程相同。不过在显示连续字符时,只须设定一次显示地址,由模块自动对地址加1指向下一个字符位置,否则,显示的字符中将会有一个空ASCII字符位置。


③当字符编码为2字节时,应先写入高位字节,再写入低位字节。


模块在接收指令前,向处理器必须先确认模块内部处于非忙状态,即读取BF标志时BF需为“0”,方可接受新的指令。如果在送出一个指令前不检查BF标志,则在前一个指令和这个指令中间必须延迟一段较长的时间,即等待前一个指令确定执行完成。指令执行的时间请参考指令表中的指令执行时间说明。⑤“RE”为基本指令集与扩充指令集的选择控制位。当变更“RE”后,以后的指令集将维持在最后的状态,除非再次变更“RE”位,否则使用相同指令集时,无需每次均重设“RE”位。


以下是经过整理的程序:


#include <reg51.h>
#include<absacc.h>
#include <intrins.h>


sbit RS = P2^5;
sbit RW = P2^4;
sbit E = P2^3;
sbit PSB = P2^2;          //串并口选择
sbit RES = P2^0;    //复位信号
bit RD1 ;
#define uchar unsigned char
#define uint unsigned int 
#define FIRST_ADDR 0       //定义字符/汉字显示起始位置


const uchar Num_Tab[]={"0123456789abcdef"};
uchar Array[]={"1234567890"};
/*uchar code logo[]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
0x10,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
0x10,0x06,0x00,0x00,0x30,0x00,0x00,0x37,0xF8,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
0x30,0x06,0x00,0x01,0x20,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x30,0x06,0x00,0x02,0x60,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x38,0x06,0x00,0x16,0x40,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
0x3C,0x06,0x00,0x24,0x00,0x3F,0x80,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
0x3C,0x0F,0x00,0x64,0x01,0xFF,0xF0,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
0x3F,0x1F,0x00,0x60,0x0F,0xFF,0xFC,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
0x17,0xBF,0xE0,0x60,0x3F,0xFF,0xFE,0x7F,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x7F,0x80,0x80,0xFF,0x00,0x3F,0x7F,0xFF,0xC0,0x00,0x00,0x00,0x01,0x80,0x00,
0x00,0x7E,0x01,0x81,0xF8,0x00,0x0F,0x01,0xE0,0x00,0x00,0x00,0x00,0x01,0xE6,0x00,
0x00,0x0E,0x03,0x43,0xEF,0xFC,0x0F,0x80,0xC0,0x00,0x00,0x00,0x00,0x03,0x7F,0x00,
0x00,0x0E,0x03,0x07,0xCF,0xFE,0x0F,0x80,0xC0,0x00,0x00,0x00,0x00,0x06,0x19,0x80,
0x00,0x0E,0x06,0x0F,0xBF,0xFE,0x0F,0x80,0xC0,0x00,0x3F,0x80,0x00,0x06,0x00,0xC0,
0x60,0x0E,0x06,0x1F,0x3F,0xBE,0x0F,0x00,0xC0,0x00,0xFF,0xC0,0x00,0x04,0x00,0xC0,
0x60,0x0E,0x0E,0x3C,0x7F,0x9E,0x0F,0x10,0xC0,0x81,0x80,0x60,0x01,0x84,0x00,0xC0,
0x60,0x0E,0x0C,0x38,0xFF,0xFE,0x1E,0x10,0xC1,0x83,0x00,0x21,0xC6,0x8C,0x00,0x60,
0x38,0x1E,0x18,0x70,0xFF,0xFE,0x3C,0x30,0xC3,0x0E,0x00,0x63,0x2C,0x8C,0xE0,0x30,
0x7F,0x9E,0x18,0x71,0xFF,0xFC,0x78,0x70,0xC3,0x18,0x00,0x62,0x29,0x8D,0xF8,0x18,
0x3E,0xBF,0x18,0xE1,0xFF,0xFC,0xF0,0x7C,0xC2,0x10,0x01,0xC2,0x25,0xF9,0x1E,0x08,
0x30,0x76,0x18,0xC1,0xFF,0xF1,0xE0,0xEC,0xC0,0x30,0x03,0x02,0x24,0xF9,0x03,0x8C,
0x20,0x66,0x11,0xC0,0xFF,0xE7,0x80,0x82,0x60,0x10,0x02,0x06,0x64,0x19,0x00,0x84,
0x20,0xC6,0x11,0x80,0xFF,0x9F,0x00,0x00,0xF0,0x19,0xC2,0x06,0x64,0x1F,0x10,0xCC,
0x01,0xC4,0x09,0x80,0x7F,0x7C,0x00,0x00,0xF8,0x0F,0x63,0x06,0x2C,0x1E,0x38,0xC8,
0x01,0x84,0x01,0x80,0x00,0xF8,0x0C,0x00,0xD8,0x00,0x23,0x06,0x38,0x12,0x01,0x98,
0x01,0x04,0x01,0x80,0x07,0xE0,0x18,0x00,0xCC,0x00,0x31,0x03,0x19,0xF6,0x01,0xF0,
0x00,0x04,0x01,0x98,0x7F,0x00,0x30,0x00,0x86,0x00,0x11,0x01,0x18,0x37,0x81,0x80,
0x00,0x04,0x01,0xC7,0xFC,0x00,0xE0,0x00,0x87,0x00,0x19,0x81,0x98,0x1D,0x9F,0x00,
0x00,0x04,0x01,0xC0,0x00,0x01,0x80,0x01,0x83,0x80,0x18,0xF0,0x98,0x18,0x03,0x00,
0x03,0x04,0x00,0xE0,0x00,0x07,0x00,0x01,0x01,0xC0,0xF8,0xD8,0x98,0xA8,0x03,0x00,
0x07,0x04,0x00,0xF0,0x00,0x1E,0x00,0x03,0x00,0xE0,0xC0,0x08,0x99,0xEF,0x3E,0x00,
0x0E,0x04,0x00,0x7C,0x00,0x7C,0x00,0x06,0x00,0x60,0xC0,0x08,0x99,0x12,0x36,0x00,
0x1C,0x04,0x00,0x3F,0xCF,0xF0,0x00,0x0C,0x00,0x30,0x40,0x0C,0x99,0x10,0x02,0x00,
0x3C,0x04,0x00,0x0F,0xFF,0xC0,0x00,0x38,0x00,0x18,0x7F,0xF8,0xFF,0x18,0x06,0x00,
0x3C,0x04,0x00,0x03,0xFF,0x00,0x00,0x60,0x00,0x00,0x3F,0xF0,0x66,0x1F,0xFC,0x00,
0x3C,0x04,0x00,0x00,0x00,0x00,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x3C,0x0C,0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x3C,0x0C,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x3C,0x0C,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
}*/


uchar code nBitmapDot1[] =                  // 数据表
{
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x01,0x3F,0xC0,0x80,0x42,0x04,0x20,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x8A,0x1F,0xFC,0x42,0x04,0xF8,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,0x01,0xFF,0xDE,0x88,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x01,0x2A,0x87,0xF0,0xA2,0x0A,0xF8,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0x84,0x10,0xA2,0x0A,0x88,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x1F,0xFC,0xA2,0x0A,0xF8,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x9F,0x90,0x05,0x2F,0xCA,0xA4,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x03,0xE1,0xA8,0x4A,0xA8,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0xBF,0xC2,0x24,0x48,0x44,0x90,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x92,0x84,0x24,0xA8,0x4A,0xA8,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0xA6,0x58,0x3D,0x0F,0xD0,0xC4,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x1C,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x23,0x08,0x37,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x40,0x10,0x08,0x40,0x00,0xFF,0x90,0x10,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x81,0x86,0x10,0x40,0x00,0x08,0x08,0x10,0xFF,0x86,0x00,0x00,0x00,0x00,0x00,
      0x01,0x02,0x49,0x40,0x40,0x00,0x7F,0x0B,0xFC,0x08,0x0F,0x00,0x00,0x00,0x00,0x00,
      0x01,0x08,0x00,0x40,0x20,0x00,0x10,0x00,0x10,0x49,0x0F,0x00,0x00,0x00,0x00,0x00,
      0x02,0x08,0x00,0x20,0x20,0x01,0xFF,0xDD,0x10,0x2A,0x0F,0x00,0x00,0x00,0x00,0x00,
      0x04,0x31,0x83,0x20,0x20,0x00,0x20,0x04,0x91,0xFF,0xC6,0x00,0x00,0x00,0x00,0x00,
      0x04,0x52,0x44,0x90,0x20,0x00,0x7F,0x04,0x90,0x1C,0x06,0x00,0x00,0x00,0x00,0x00,
      0x09,0xA4,0x28,0x4C,0x10,0x00,0xA1,0x04,0x10,0x2A,0x00,0x00,0x00,0x00,0x00,0x00,
      0x0E,0x44,0xE9,0xC3,0x90,0x01,0x3F,0x04,0x70,0x49,0x06,0x00,0x00,0x00,0x00,0x00,
      0x00,0x82,0xC5,0x81,0x70,0x00,0x21,0x0A,0x01,0x88,0xC6,0x00,0x00,0x00,0x00,0x00,
      0x01,0x01,0x83,0x00,0x80,0x00,0x3F,0x11,0xFC,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
      0x01,0x0C,0x70,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x02,0x13,0x87,0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x02,0x20,0x78,0xA0,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x02,0x20,0x00,0x60,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x02,0x21,0x80,0x60,0x40,0x00,0x00,0x71,0xEE,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,
      0x01,0x11,0x98,0x90,0x80,0x00,0x00,0x8E,0x31,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,
      0x01,0x08,0x18,0x80,0x80,0x00,0x01,0x24,0x24,0x83,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x96,0x01,0x01,0x00,0x00,0x01,0x40,0x28,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x49,0x86,0x03,0x00,0x00,0x01,0x40,0x28,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x34,0x78,0x8C,0x00,0x00,0x01,0x00,0x20,0x03,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x0E,0x01,0x30,0x00,0x00,0x00,0x80,0x30,0x06,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x71,0x87,0xCE,0x00,0x00,0x00,0x40,0x68,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0xE0,0x78,0x07,0x00,0x00,0x00,0x20,0xC4,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
      0x01,0xAF,0xFF,0xC5,0x80,0x00,0x00,0x11,0x82,0x30,0x00,0x00,0x00,0x00,0x00,0x00,
      0x03,0xA9,0xB6,0x45,0xC0,0x00,0x00,0x0B,0x01,0x60,0x00,0x00,0x00,0x00,0x00,0x00,
      0x07,0x2F,0x03,0xC4,0xE0,0x00,0x00,0x06,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
      0x0E,0x16,0x01,0x88,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x0F,0x08,0x00,0x10,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x0F,0x84,0x00,0x21,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};


uchar code nBitmapDot2[] =                  // 数据表
{
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x06,0x30,0x01,0xE0,0x00,0x00,0x2A,0x00,0x00,0xD8,0x00,0x00,0x00,0x00,0x00,
      0x00,0x0F,0x7B,0x63,0xE0,0x00,0x00,0x22,0x00,0x01,0x24,0x00,0x00,0x00,0x00,0x00,
      0x00,0x0F,0xFB,0x63,0x07,0x34,0x00,0x14,0x00,0x01,0x04,0x00,0x00,0x00,0x00,0x00,
      0x00,0x0D,0xDB,0x63,0x01,0xBC,0x00,0x08,0x00,0x00,0x88,0x00,0x00,0x00,0x00,0x00,
      0x00,0x0C,0x1B,0x63,0x07,0xB0,0x00,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,
      0x00,0x0C,0x1B,0x63,0xED,0xB0,0xDB,0x00,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00,
      0x00,0x0C,0x19,0xE1,0xE7,0xB0,0xDB,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x0C,0x19,0xE1,0xE7,0xB0,0xDB,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x03,0xC0,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x05,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x0A,0x80,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x0A,0x00,0x00,0xFF,0xF8,0xE0,0x05,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x06,0xC0,0x15,0x00,0x1F,0xFF,0xFF,0xC0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x09,0x20,0x11,0x00,0xFB,0xFF,0xE1,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x08,0x20,0x0A,0x03,0x9F,0x00,0x9E,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x04,0x40,0x04,0x0E,0x70,0x00,0x81,0xC7,0x80,0x01,0x40,0x00,0x00,0x00,0x00,
      0x00,0x02,0x80,0x00,0x1D,0x80,0x00,0xE0,0x61,0xE0,0x02,0xA0,0x00,0x00,0x00,0x00,
      0x00,0x01,0x00,0x00,0x77,0x9F,0xFC,0xF0,0x18,0xF8,0x02,0x20,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x01,0xDF,0x00,0x00,0xF3,0x0C,0x3C,0x01,0x40,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x03,0x9E,0x00,0x00,0xF8,0x06,0x1E,0x00,0x80,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x07,0x0E,0x30,0x01,0xFC,0x7F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x07,0x0E,0x30,0x01,0xFC,0x7F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x7E,0xFF,0xFF,0xFF,0xFF,0xFF,0x83,0xC0,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x0F,0xFD,0xFF,0xFF,0xFF,0xFF,0xFC,0x01,0xF0,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x3F,0x81,0xFF,0x00,0x00,0x00,0x00,0x1F,0xF0,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0xFE,0xF0,0x00,0x00,0x01,0x00,0x00,0xC0,0x1C,0x00,0x00,0x00,0x00,0x00,
      0x00,0x03,0xC0,0x07,0x80,0x00,0x03,0xE0,0x07,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,
      0x00,0x03,0x80,0x03,0x40,0x00,0x03,0xE0,0x0C,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,
      0x00,0x07,0x00,0x00,0xC0,0x00,0x00,0x20,0x18,0x00,0x07,0x00,0x00,0x00,0x00,0x00,
      0x00,0x09,0x01,0x80,0x60,0x00,0x00,0x20,0x73,0x9F,0x03,0x80,0x00,0x00,0x00,0x00,
      0x00,0x1E,0x0F,0xF2,0x20,0x00,0x00,0x20,0x67,0xFF,0xC1,0xC0,0x00,0x00,0x00,0x00,
      0x00,0x1E,0x1F,0xF9,0x30,0x00,0x00,0x20,0xEF,0xFF,0xE0,0xE0,0x00,0x00,0x00,0x00,
      0x00,0x38,0x3F,0xFC,0x90,0x00,0x00,0x20,0xCB,0xFF,0xF9,0xF0,0x00,0x00,0x00,0x00,
      0x00,0x7F,0x7F,0xFE,0x10,0x00,0x00,0x20,0xDB,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,
      0x00,0x6E,0xF9,0xBF,0x10,0x00,0x00,0x20,0xF7,0xED,0xFF,0xF0,0x00,0x00,0x00,0x00,
      0x00,0x7C,0xFC,0x3F,0x10,0x00,0x00,0x20,0x67,0xE1,0xFD,0xE0,0x00,0x00,0x00,0x00,
      0x00,0x7C,0xFC,0x3F,0x10,0x00,0x00,0x20,0x67,0xE1,0xFD,0xE0,0x00,0x00,0x00,0x00,
      0x00,0x38,0xFC,0x3F,0x18,0x00,0x00,0x20,0x87,0xE0,0xFD,0xC0,0x00,0x00,0x00,0x00,
      0x00,0x38,0xF1,0x8F,0x18,0x00,0x1F,0xE7,0x87,0x9C,0x7D,0xC0,0x00,0x00,0x00,0x00,
      0x00,0x1C,0xFE,0x1F,0x81,0xFF,0xFF,0xC0,0x0F,0xE0,0xFF,0x80,0x00,0x00,0x00,0x00,
      0x00,0x0C,0xFC,0x3F,0x80,0x00,0x00,0x00,0x0F,0xE1,0xF8,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0xF9,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEC,0xFE,0x00,0x00,0x00,0x00,0x00,
      0x00,0x03,0xF9,0xBF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,
      0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
//延时子程序
void delay(uint t)

  uint i,j;
  for(i=0;i<t;i++)
    for(j=0;j<10;j++)
       ;
}


//测忙
void chk_busy()

   RD1=1;
   delay(5);
   RS="0";
   RW="1";
   E="1";


   while((P0&0x80)==0x80);
   E="0";
   RD1=0;
}


//读数据
uchar lcdrd()

   uchar i;
   RD1=1;
   RS="1";
   RW="1";
   _nop_();
   E="1";
   delay(5);
   i="P0";
   _nop_();
   E="0";
   return i;
}


//写数据
void lcdwd(uchar dispdata)

   chk_busy();
    RD1=1;
   _nop_();


   RS="1";
   RW="0";
   P0=dispdata;
   E="1";
   delay(5);
   _nop_();
   E="0";
   _nop_();
   P0=0xff;
}


//写指令代码
void lcdwc(uchar cmdcode)
{  chk_busy();
   RD1=1;
   _nop_();


   RS="0";
   RW="0";
   P0=cmdcode;
   E="1";
   delay(5);
   _nop_();
   E="0";
   _nop_();
   P0=0xff;
}
void Disp_img(uchar  *img) //图形方式12864显示字模221 横向取膜
{
uchar i,j;
uint k = 0;



  lcdwc(0x36); //图形方式
  for(i=0;i<32;i++)
   {
    lcdwc(0x80+i);   //1~32行
    lcdwc(0x80);   //显示在上半屏的起始地址
   for(j=0;j<16;j++)  //取显示数据,每行16个8为二进制数据,共16*8=128个点阵
    {
     lcdwd(img[k++]);
     }
    }


  for(i=0;i<32;i++)
   {
     lcdwc(0x80+i);  //第33~64行
     lcdwc(0x88);  //显示在下半屏的起始地址,
    for(j=0;j<16;j++)
     {
       lcdwd(img[k++]);
      }
    }
}



//初始化
void lcdreset()
{  delay(2000);
   lcdwc(0x30);       //选择基本指令集
   lcdwc(0x30);       //选择8bit数据流
   delay(5);
   lcdwc(0x0c);       //开显示(无游标、不反白)
   delay(5);
   lcdwc(0x01);       //清除显示,并且设定地址指针为00H
   delay(5);
   lcdwc(0x06);       //指定在资料的读取及写入时,设定游标的移动方向及指定显示的移位
}


//显示汉字(串)
void hzkdis(uchar code *s)
{  while(*s>0)
   {  lcdwd(*s);
      s++;
      delay(500);
   }
}


//显示固定字符、汉字
void hzklib()

   lcdwc(0x80+FIRST_ADDR);
   hzkdis("欢迎使用自带字库");
   lcdwc(0x90+FIRST_ADDR);
   hzkdis("液晶显示12864     ");
   lcdwc(0x88+FIRST_ADDR);
   hzkdis("中国    武汉          ");
   lcdwc(0x98+FIRST_ADDR);
   hzkdis("设计者:殷海波 ");
   delay(1000);
   lcdwc(0x01);
   delay(1000);
   lcdwc(0x80+FIRST_ADDR);
   hzkdis("0123456789abcdef");
   lcdwc(0x90+FIRST_ADDR);
   hzkdis("ghijklmnopqrstuv");
   lcdwc(0x88+FIRST_ADDR);
   hzkdis("wxyzABCDEFGHIJKL");
   lcdwc(0x98+FIRST_ADDR);
   hzkdis("MNOPQRSTUVWXYZ  ");


}


//显示单个字符,显示位置设置:x:行(0~3);y:列(0~8);n:位数
void One_Char_disp(uchar X,uchar Y,uchar One_Ch)

  lcdwc(0x30);
  switch(X)
   {
     case 0:
    lcdwc(0x80+Y);break;
  case 1:
    lcdwc(0x90+Y);break;
  case 2:
    lcdwc(0x88+Y);break;
  case 3:
    lcdwc(0x98+Y);break;
 default:break;
 }
   lcdwd(One_Ch);
}


//显示字符串。显示位置设置:x:行(0~3);y:列(0~8);n:位数
void String_disp(uchar XX,uchar YY,int n,uchar *String_Ch)

  uchar i;
  lcdwc(0x30);
  switch(XX)
   {
     case 0:
    lcdwc(0x80+YY);break;
  case 1:
    lcdwc(0x90+YY);break;
  case 2:
    lcdwc(0x88+YY);break;
  case 3:
    lcdwc(0x98+YY);break;
 default:break;
 }
 for(i=0;i<n;i++)
     {lcdwd(String_Ch);}
}


//整屏显示??
//当ii=0时显示上面128×32
//当ii=8时显示下面128×32
void lcdfill(uchar disdata)
{  uchar x,y,ii;
   for(ii=0;ii<9;ii+=8)
      for(y=0;y<0x20;y++)
         for(x=0;x<16;x++)
         {  lcdwc(0x36);
            lcdwc(y+0x80);        //行地址
            lcdwc(x+0x80+ii);     //列地址
            lcdwc(0x30);
            lcdwd(disdata);
            lcdwd(disdata);
         }
}


void main()
{  RES="0";
   _nop_();
   RES="1";
   PSB="1" ;
  
   //lcdreset();       //初始化LCD屏
   while(1)
   { 
      RW="0";
   lcdreset();       //初始化LCD屏
      lcdwc(0x01);
      delay(1000);
      //lcdfill(0xff);
      delay(6000);
      //lcdfill(0);
      lcdwc(0x01);
      delay(1000);
      hzklib();
      delay(4000);
  
      lcdwc(0x01);
      delay(1000);
      /*Disp_img(logo); //显示湘灵电子LOGO
      delay(4000);
   lcdwc(0x01);
      delay(1000); */
   Disp_img(nBitmapDot1);
   delay(4000);
   lcdwc(0x01);
      delay(1000);
   Disp_img(nBitmapDot2);
   delay(4000);
   lcdwc(0x30);
   lcdwc(0x01);
      delay(1000);
   String_disp(0,0,16,Array);
   delay(4000);
   lcdwc(0x01);
      delay(1000);
   One_Char_disp(0,0,Num_Tab[0]);
   delay(4000);
   }
}

PARTNER CONTENT

文章评论5条评论)

登录后参与讨论

用户377235 2014-3-18 20:45

不错不错

用户377235 2014-3-18 20:45

不错不错

用户398463 2009-5-24 11:17

大家多多交流~

用户145263 2009-4-11 19:16

不错不错。小弟也做过啊。呵呵。支持分享

tengjingshu_112148725 2009-4-11 16:03

谢谢分享
相关推荐阅读
用户398463 2009-05-24 11:15
各种电容的用途和性能区分
转自Emile的工作收藏:【电容专题】什么是CBB电容,独石电容,电解电容?1、聚酯(涤纶)电容(CL) 电容量:40p--4u 额定电压:63--630V 主要特点:小体积,大容量,耐热耐湿,稳定性...
用户398463 2009-04-11 12:38
液晶1602的单片机控制程序
#include <reg52.h>#include <intrins.h>#include<absacc.h>   #define uchar unsigned ...
用户398463 2009-04-11 12:22
4*4行列式键盘扫描程序
uchar code keytab[]={0x7E,0x7D,0x7B,0x77,  //0,1,2,3,                     0xBE,0xBD,0xBB,0xB7,   //4...
用户398463 2009-04-11 12:22
ByteBlasterII下载线电路图
此电路所制作的下载线既可以用来下载51单片机的程序,也可以用来下载FPGA/CPLD的程序。...
EE直播间
更多
我要评论
5
5
关闭 站长推荐上一条 /3 下一条