SYB12864B1V11单页资料-Model
- 格式:pdf
- 大小:89.85 KB
- 文档页数:1
HS12864B液晶显示模块使用说明书感谢您关注和使用我们的液晶产品。
如果您在使用中有任何疑问,请拨打我们的客户服务热线寻求技术支持和获取相关资料,我们竭诚为您服务。
您可以登录我们的网站了解最新产品信息。
或者您可以在我公司网站的留言簿栏目留下您宝贵的意见。
深圳汉昇实业有限公司SHENZHEN HANSHENG INDUSTRIAL CO.,LTD地址:深圳市南山区西丽镇官龙工业村东区18栋5楼邮编:518055公司主页:联系电话:传真:一、 概述HS12864B 使用KS0108(或其兼容芯片)作为控制器,适配M6800系列时序,具有8位标准数据总线。
可显示各种字符及图形。
每个KS0108拥有64×64位(512字节)的显示RAM ,HS12864B 显示屏上的64×64点,显示RAM 中的数据直接作为显示驱动信号。
HS12864B 具有操作指令简单,低功耗的特点。
HS12864B 采用COB 工艺制作。
说明:HS12864B 有STN 黄绿膜,蓝膜以及FSTN 产品可选,LED 背光有多种颜色可选。
用户还可以根据需要自己选定常温、宽温或者超宽温产品。
二、 外形结构1. 外形图2.114-?2. 主要外形尺寸项 目 标 准 尺 寸单 位模 块 体 积 93.0L ×70.0W ×13.0(max )H mm视 域 70.7×38.8 mm 行 列 点 阵 数 128×64 dots 点 距 离 0.48×0.48 mm 点 大 小0.52×0.52 mm三、 硬件说明1. 接口定义管脚符号电平功能描述1 CS1 L 片选信号1,低有效,对应左半屏64×64点2 CS2 L 片选信号2,低有效,对应右半屏64×64点与CSA,CSB不可同时使用3 VSS 0V 电源地4 VDD 5.0V 供电电源,5.0V5 V0 负压 LCD驱动电压输入端(对比度调节)6 RS H/L 寄存器选择端高:数据寄存器低:命令寄存器7 R/W H/L 读/写信号高:读操作低:写操作8 E H,H->L 使能信号9 ~16 DB0~DB7H/L 数据线17 CSA H 片选信号1,高有效,对应左半屏64×64点18 CSB H 片选信号2,高有效,对应右半屏64×64点与CS1,CS2不可同时使用19 /RST H/L 复位信号,低有效20 V out 负压负压输出端21 LEDA 5.0V 背光正极22 LEDK 0V 背光负极说明:HS12864B有两套片选信号,分别是CS1,CS2和CSA,CSB,分别是低有效和高有效,以适应不同用户的需求。
12864液晶名称含义12864是128*64点阵液晶模块的点阵数简称,业界约定俗成的简称。
基本参数液晶屏类型 STN FSTN模块显示效果:黄绿底黑字蓝底白字白底黑字视角6点钟12点钟驱动方式 1/64 DUTY 1/9 BIAS背光LED白色LED黄绿色控制器KS0108或兼容ST7920 T6963C数据总线 8 位并口/6800 方式串口温度特性工作温度:-20℃~+70℃ 储藏温度:-30℃~+80℃点阵格式 128 x 64基本用途:该点阵的屏显成本相对较低,适用于各类仪器,小型设备的显示领域。
基本用途:该点阵的屏显成本相对较低,适用于各类仪器,小型设备的显示领域。
液晶模组使用注意事项1 当您在你的产品设计中使用本液晶模组,注意液晶的视角与你的产品用途相一致。
2 液晶屏是玻璃为基础的,跌落或与硬物撞击会引起液晶屏破裂或粉碎。
尤其是边角处。
3 尽管在液晶表面的偏振片有抑制反光的表层,应当小心不要划伤表面,一般推荐在液晶表面采用透明塑胶材料的保护屏。
4 如果液晶模组储藏在低于规定的温度以下,液晶材料会凝结而性能恶化。
如果液晶模组储藏在高于规定的温度以上,液晶材料的分子排列方向会转变为液态,可能无法恢复到原来的状态。
超出温度和湿度范围,会引起偏振片剥落或起泡。
因此,液晶模组应储藏在规定的温度范围。
5 如液晶表面遇口水或滴水,应立即擦除,避免长时间过后引起色彩变化或留下污点。
水蒸气会引起ITO电极腐蚀。
6 如果需要清洁液晶屏表面,应该用棉或软布轻快地擦拭,仍不能清除时,呵气之后再擦拭。
7 液晶模组的驱动应遵照规定的额定指标,避免故障及永久损坏。
对液晶材料施加直流电压,会引起液晶材料迅速恶化,应该确保提供交流波形的M信号的连续应用。
特别是,在电源开关时应遵照供电顺序,避免驱动锁存及直流直接加至液晶屏。
8 机械注意事项:a) 液晶模组是在高精度下调试安装的。
避免外力撞击,不要对其改变或修改。
b) 不要篡改金属框的任何突出部分。
一、液晶显示模块概述FM12864M汉字图形点阵液晶显示模块,可显示汉字及图形,内置8192个中文汉字(16X16点阵)、128个字符(8X16点阵)及64X256点阵显示RAM(GDRAM)。
主要技术参数和显示特性:电源:VDD 3.3V~+5V(内置升压电路,无需负压);显示内容:128列× 64行显示颜色:黄绿显示角度:6:00钟直视LCD类型:STN与MCU接口:8位或4位并行/3位串行配置LED背光多种软件功能:光标显示、画面移位、自定义字符、睡眠模式等二、外形尺寸外观尺寸:93×70×12.5mm 视域尺寸:73×39mm二、模块引脚说明17128X64HZ 引脚说明引脚号引脚名称方向功能说明1 VSS - 模块的电源地2 VDD +5V 模块的电源正端3 V0 - LCD驱动电压输入端4 RS(CS) H/L 并行的指令/数据选择信号;串行的片选信号5 R/W(SID) H/L 并行的读写选择信号;串行的数据口6 E(CLK) H/L 并行的使能信号;串行的同步时钟7 DB0 H/L 数据08 DB1 H/L 数据19 DB2 H/L 数据210 DB3 H/L 数据311 DB4 H/L 数据412 DB5 H/L 数据513 DB6 H/L 数据614 DB7 H/L 数据715 PSB H/L 并/串行接口选择:H-并行;L-串行16 NC 空脚17 RESET H/L 复位低电平有效18 NC 空脚19 LED_A (LED+5V)背光源正极20 LED_K (LED-OV)背光源负极逻辑工作电压(VDD):4.5~5.5V电源地(GND):0V工作温度(Ta):-10℃~60℃(常温) / -20℃~70℃(宽温)三、接口时序模块有并行和串行两种连接方法(时序如下):8位并行连接时序图MPU写资料到模块串行数据传送共分三个字节完成:第一字节:串口控制—格式11111ABCA为数据传送方向控制:H表示数据从LCD到MCU,L表示数据从MCU 到LCDB为数据类型选择:H表示数据是显示数据,L表示数据是控制指令C固定为0第二字节:(并行)8位数据的高4位—格式DDDD0000第三字节:(并行)8位数据的低4位—格式0000DDDD串行接口时序参数:(测试条件:T=25℃VDD=4.5V)四、用户指令集1、指令表1:(RE=0:基本指令集)指令指令码说明执行时间(540KHZ)RS RW DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0清除显示 0 0 0 0 0 0 0 0 0 1 将DDRAM填满“20H”,并且设定DDRAM 的地址计数器(AC)到“00H” 4.6ms地址归位 0 0 0 0 0 0 0 0 1 X 设定DDRAM的地址计数器(AC)到“00H”,并且将游标移到开头原点位置;这个指令并不改变DDRAM的内容 4.6ms进入点设定 0 0 0 0 0 0 0 1 I/D S 指定在资料的读取与写入时,设定游标移动方向及指定显示的移位 72us显示状态开/关 0 0 0 0 0 0 1 D C B D=1:整体显示ONC=1:游标ONB=1:游标位置ON 72us游标或显示移位控制 0 0 0 0 0 1 S/C R/L X X 设定游标的移动与显示的移位控制位元;这个指令并不改变DDRAM的内容 72us功能设定 0 0 0 0 1 DL X 0RE X X DL=1 (必须设为1)RE=1:扩充指令集动作RE=0:基本指令集动作 72us设定CGRAM地址 0 0 0 1 AC5 AC4 AC3 AC2 AC1 AC0 设定CGRAM 地址到地址计数器(AC) 72us设定DDRAM地址 0 0 1 AC6 AC5 AC4 AC3 AC2 AC1 AC0 设定DDRAM地址到地址计数器(AC) 72us读取忙碌标志(BF)和地址 0 1 BF AC6 AC5 AC4 AC3 AC2 AC1 AC0 读取忙碌标志(BF)可以确认内部动作是否完成,同时可以读出地址计数器(AC)的值 0us写资料到RAM 1 0 D7 D6 D5 D4 D3 D2 D1 D0 写入资料到内部的RAM (DDRAM/CGRAM/IRAM/GDRAM) 72us读出RAM的值 1 1 D7 D6 D5 D4 D3 D2 D1 D0 从内部RAM读取资料(DDRAM/CGRAM/IRAM/GDRAM) 72us指令表—2:(RE=1:扩充指令集)指令指令码说明执行时间(540KHZ)RS RW DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0待命模式 0 0 0 0 0 0 0 0 0 1 将DDRAM填满“20H”,并且设定DDRAM 的地址计数器(AC)到“00H” 72us卷动地址或IRAM地址选择 0 0 0 0 0 0 0 0 1 SR SR=1:允许输入垂直卷动地址SR=0:允许输入IRAM地址 72us反白选择 0 0 0 0 0 0 0 1 R1 R0 选择4行中的任一行作反白显示,并可决定反白与否 72us睡眠模式 0 0 0 0 0 0 1 SL X X SL=1:脱离睡眠模式SL=0:进入睡眠模式 72us扩充功能设定 0 0 0 0 1 1 X 1RE G 0 RE=1:扩充指令集动作RE=0:基本指令集动作G=1 :绘图显示ONG=0 :绘图显示OFF 72us设定IRAM地址或卷动地址 0 0 0 1 AC5 AC4 AC3 AC2 AC1 AC0 SR=1:AC5—AC0为垂直卷动地址SR=0:AC3—AC0为ICON IRAM地址 72us设定绘图RAM地址 0 0 1 AC6 AC5 AC4 AC3 AC2 AC1 AC0 设定CGRAM地址到地址计数器(AC) 72us备注:1、当模块在接受指令前,微处理顺必须先确认模块内部处于非忙碌状态,即读取BF标志时BF需为0,方可接受新的指令;如果在送出一个指令前并不检查BF标志,那么在前一个指令和这个指令中间必须延迟一段较长的时间,即是等待前一个指令确实执行完成,指令执行的时间请参考指令表中的个别指令说明。
4.3 12864LCD4.3.1点阵LCD的显示原理在数字电路中,所有的数据都是以0和1保存的,对LCD控制器进行不同的数据操作,可以得到不同的结果。
对于显示英文操作,由于英文字母种类很少,只需要8位(一字节)即可。
而对于中文,常用却有6000以上,于是我们的DOS 前辈想了一个办法,就是将ASCII表的高128个很少用到的数值以两个为一组来表示汉字,即汉字的内码。
而剩下的低128位则留给英文字符使用,即英文的内码。
4.3.2 12864点阵型LCD简介12864是一种图形点阵液晶显示器,它主要由行驱动器/列驱动器及128×64全点阵液晶显示器组成。
可完成图形显示,也可以显示8×4个(16×16点阵)汉字。
表1:12864LCD的引脚说明4.3.3 12864内部功能器件及相关功能1. 指令寄存器(IR)IR是用于寄存指令码,与数据寄存器数据相对应。
当D/I=0时,在E信号下降沿的作用下,指令码写入IR。
2.数据寄存器(DR)DR是用于寄存数据的,与指令寄存器寄存指令相对应。
当D/I=1时,在下降沿作用下,图形显示数据写入DR,或在E信号高电平作用下由DR读到DB7∽DB0数据总线。
DR和DDRAM之间的数据传输是模块内部自动执行的。
3.忙标志:BFBF标志提供内部工作情况。
BF=1表示模块在内部操作,此时模块不接受外部指令和数据。
BF=0时,模块为准备状态,随时可接受外部指令和数据。
利用STATUS READ指令,可以将BF读到DB7总线,从检验模块之工作状态。
4.显示控制触发器DFF此触发器是用于模块屏幕显示开和关的控制。
DFF=1为开显示(DISPLAY OFF),DDRAM的内容就显示在屏幕上,DFF=0为关显示(DISPLAY OFF)。
DDF的状态是指令DISPLAY ON/OFF和RST信号控制的。
5.XY地址计数器XY地址计数器是一个9位计数器。
高3位是X地址计数器,低6位为Y地址计数器,XY地址计数器实际上是作为DDRAM的地址指针,X地址计数器为DDRAM 的页指针,Y地址计数器为DDRAM的Y地址指针。
学习笔记:12864液晶模块的详细使用备注:这篇文章是对12864操作的具体介绍,仅限刚接触12864的新手,大神请拍砖,文章写的较散,建议先参考12864手册及控制驱动器ST7920英文手册有个初步理解之后再阅读该篇文章,将会有更深的认识。
强烈建议阅读ST7920英文手册,细节内容里面有详细介绍,中文的12864也是从中译过来的。
本文分三个步骤介绍12864的内部资源原理,指令集详细讲解,以及应用例子。
对12864的所有操作概括起来有4种:1)、读忙状态(同时读出指针地址内容),初始化之后每次对12864的读写均要进行忙检测。
2)、写命令:所有的命令可以查看指令表,后续讲解指令的详细用法。
写地址也是写指令。
3)、写数据:操作对象有DDRAM、CGRAM、GDRAM。
4)、读数据:操作对象也是DDRAM、CGRAM、GDRAM。
对12864的学习首相要了解其内部资源,知道了它里面有哪些东西,你就可以更加方便的使用它。
先介绍几个英文的名字:DDRAM:(Data Display Ram),数据显示RAM,往里面写啥,屏幕就会显示啥。
CGROM:(Character Generation ROM),字符发生ROM。
里面存储了中文汉字的字模,也称作中文字库,编码方式有GB2312(中文简体)和BIG5(中文繁体)。
笔者使用的是育松电子的QC12864B,讲解以此为例。
CGRAM:(Character Generation RAM),字符发生RAM,,12864内部提供了64×2B的CGRAM,可用于用户自定义4个16×16字符,每个字符占用32个字节。
GDRAM:(Graphic Display RAM):图形显示RAM,这一块区域用于绘图,往里面写啥,屏幕就会显示啥,它与DDRAM的区别在于,往DDRAM中写的数据是字符的编码,字符的显示先是在CGROM中找到字模,然后映射到屏幕上,而往GDRAM中写的数据时图形的点阵信息,每个点用1bit来保存其显示与否。
12864液晶模块文档带中文字库的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/5BIASl 视角方向:6点l 背光方式:侧部高亮白色LED,功耗仅为普通LED的1/5—1/10l 通讯方式:串行、并口可选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 - 对比度(亮度)调整4RS(CS)H/LRS=“H”,表示DB7——DB0为显示数据RS=“L”,表示DB7——DB0为显示指令数据5R/W(SID) H/L R/W=“H”,E=“H”,数据被读到DB7——DB0R/W=“L”,E=“H→L”, DB7——DB0的数据被写到IR或DR6 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”用焊锡短接。
(一)概述 (3)(二)外形尺寸1 方框图 (3)2 外型尺寸图 (4)(三)模块的接口 (4)(四)硬件说明 (5)(五) 指令说明 (7)(五)读写操作时序 (8)(六)交流参数 (11)(七)软件初始化过程 (12)(八)应用举例 (13)(九)附录1半宽字符表 (20)2 汉字字符表 (21)一、概述带中文字库的128X64是一种具有4位/8位并行、2线或3线串行多种接口方式,内部含有国标一级、二级简体中文字库的点阵图形液晶显示模块;其显示分辨率为128×64, 内置8192个16*16点汉字,和128个16*8点ASCII字符集.利用该模块灵活的接口方式和简单、方便的操作指令,可构成全中文人机交互图形界面。
可以显示8×4行16×16点阵的汉字. 也可完成图形显示.低电压低功耗是其又一显著特点。
由该模块构成的液晶显示方案与同类型的图形点阵液晶显示模块相比,不论硬件电路结构或显示程序都要简洁得多,且该模块的价格也略低于相同点阵的图形液晶模块。
基本特性:●低电源电压(VDD:+3.0--+5.5V)●显示分辨率:128×64点●内置汉字字库,提供8192个16×16点阵汉字(简繁体可选)●内置 128个16×8点阵字符●2MHZ时钟频率●显示方式:STN、半透、正显●驱动方式:1/32DUTY,1/5BIAS●视角方向:6点●背光方式:侧部高亮白色LED,功耗仅为普通LED的1/5—1/10●通讯方式:串行、并口可选●内置DC-DC转换电路,无需外加负压●无需片选信号,简化软件设计●工作温度: 0℃ - +55℃ ,存储温度: -20℃ - +60℃二、方框图3、外形尺寸图三、模块接口说明*注释1:如在实际应用中仅使用串口通讯模式,可将PSB接固定低电平,也可以将模块上的J8和“GND”用焊锡短接。
*注释2:模块内部接有上电复位电路,因此在不需要经常复位的场合可将该端悬空。
FYD12864液晶中文显示模块(一) (一)概述 (3)(二)(二)外形尺寸1 方框图 (3)2 外型尺寸图 (4)(三)(三)模块的接口 (4)(四)(四)硬件说明 (5)(五) 指令说明 (7)(五)(五)读写操作时序 (8)(六)(六)交流参数 (11)(七)(七)软件初始化过程 (12)(八)(八)应用举例 (13)(九)(九)附录1半宽字符表 (20)2 汉字字符表 (21)一、概述FYD12864-0402B是一种具有4位/8位并行、2线或3线串行多种接口方式,内部含有国标一级、二级简体中文字库的点阵图形液晶显示模块;其显示分辨率为128×64, 内置8192个16*16点汉字,和128个16*8点ASCII字符集.利用该模块灵活的接口方式和简单、方便的操作指令,可构成全中文人机交互图形界面。
可以显示8×4行16×16点阵的汉字. 也可完成图形显示.低电压低功耗是其又一显著特点。
由该模块构成的液晶显示方案与同类型的图形点阵液晶显示模块相比,不论硬件电路结构或显示程序都要简洁得多,且该模块的价格也略低于相同点阵的图形液晶模块。
基本特性:●●低电源电压(VDD:+3.0--+5.5V)●●显示分辨率:128×64点●●内置汉字字库,提供8192个16×16点阵汉字(简繁体可选)●●内置 128个16×8点阵字符●●2MHZ时钟频率●●显示方式:STN、半透、正显●●驱动方式:1/32DUTY,1/5BIAS●●视角方向:6点●●背光方式:侧部高亮白色LED,功耗仅为普通LED的1/5—1/10 ●●通讯方式:串行、并口可选●●内置DC-DC转换电路,无需外加负压●●无需片选信号,简化软件设计●●工作温度: 0℃ - +55℃ ,存储温度: -20℃ - +60℃二、方框图3、外形尺寸图三、模块接口说明*注释1:如在实际应用中仅使用串口通讯模式,可将PSB接固定低电平,也可以将模块上的J8和“GND”用焊锡短接。
12864LCD液晶显示屏中文资料一、概述二、带中文字库的128X64是一种具有4位/8位并行、2线或3线串行多种接口方式,内部含有国标一级、二级简体中文字库的点阵图形液晶显示模块;其显示分辨率为128×64, 内置8192个16*16点汉字,和128个16*8点ASCII字符集.利用该模块灵活的接口方式和简单、方便的操作指令,可构成全中文人机交互图形界面。
可以显示8×4行16×16点阵的汉字. 也可完成图形显示.低电压低功耗是其又一显著特点。
由该模块构成的液晶显示方案与同类型的图形点阵液晶显示模块相比,不论硬件电路结构或显示程序都要简洁得多,且该模块的价格也略低于相同点阵的图形液晶模块。
三、基本特性:(1)、低电源电压(VDD:+3.0--+5.5V)(2)、显示分辨率:128×64点(3)、内置汉字字库,提供8192个16×16点阵汉字(简繁体可选) (4)、内置128个16×8点阵字符(5)、2MHZ时钟频率(6)、显示方式:STN、半透、正显(7)、驱动方式:1/32DUTY,1/5BIAS (8)、视角方向:6点(9)、背光方式:侧部高亮白色LED,功耗仅为普通LED的1/5—1/10 (10)、通讯方式:串行、并口可选(11)、内置DC-DC转换电路,无需外加负压(12)、无需片选信号,简化软件设计(13)、工作温度: 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/LRS=“H”,表示DB7——DB0为显示数据RS=“L”,表示DB7——DB0为显示指令数据5 R/W(SID)H/LR/W=“H”,E=“H”,数据被读到DB7——DB0R/W=“L”,E=“H→L”, DB7——DB0的数据被写到IR或DR6 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 /RESETH/L 复位端,低电平有效(见注释2)18 VOUT - LCD驱动电压输出端19 A VDD背光源正端(+5V)(见注释3)20 K VSS 背光源负端(见注释3)*注释1:如在实际应用中仅使用并口通讯模式,可将PSB接固定高电平,也可以将模块上的J8和“VCC”用焊锡短接。
12864液晶显示资料及程序硬件连接方式是:并口直接访问。
这是汉字显示程序:#include<reg51.h>#include<absacc.h>#define uchar unsigned char#define datawr 0x1200 //写数据通道#define comwr 0x1000 //写控制命令通道#define datare 0x1300 //读数据通道#define comre 0x1100 //读忙通道uchar code disp_data[]={" 浙江大学" //第一行,第一页"04级通信工程一班" //第三行" 宁波理工学院" //第二行" 竞赛小组" //第四行"128X64液晶显示器" //第一行,第二页" 测试程序" //第三行" 07年07月25日" //第二行" Tornado "}; //第四行void set12864();void write_command(uchar command);void write_page(uchar data_add);void read_page(uchar data_add);void delays(uchar cont);void main(){while(1){set12864(); //初始化12864write_page(0); //写入一页数据read_page(0x30); //读出一页数据到内部RAMdelays(2); //延时2swrite_page(64); //写入下一页数据delays(2); //延时2s}}//初始化12864子程序void set12864(){write_command(0x30); //功能设定控制字write_command(0x0c); //显示开关控制字write_command(0x01); //清除屏幕控制字write_command(0x06); //进入设定点控制字}//写控制命令子程序void write_command(uchar command){bit flag=1; //12864空闲标志位while(flag) //检查12864是否空闲flag="XBYTE"[comre]&0x80;XBYTE[comwr]=command; //空闲传送控制字}//写一页子程序void write_page(uchar data_add){bit flag=1; //12864空闲标志位uchar num=64; //64个循环,连续写入32个汉字或是64个西文字符write_command(0x80);for(;num>0;num--){while(flag) //检查12864是否空闲flag="XBYTE"[comre]&0x80;XBYTE[datawr]=disp_data[data_add++]; //空闲传送数据}}//读一页子程序void read_page(uchar data_add){bit flag=1; //12864空闲标志位uchar num=64; //64个循环,连续写入32个汉字或是64个西文字符write_command(0x80);for(;num>0;num--){while(flag) //检查12864是否空闲flag="XBYTE"[comre]&0x80;DBYTE[data_add++]=XBYTE[datare]; //空闲传送数据}}//延时cont秒子程序void delays(uchar count){unsigned char h,i,j,k;do{for(h=5;h>0;h--)for(i=4;i>0;i--)for(j=116;j>0;j--)for(k=214;k>0;k--);}while(--count);}这是图象显示程序:#include<reg51.h>#include<absacc.h>#define uchar unsigned char#define uint unsigned int#define datawr 0x1200 //写数据通道#define comwr 0x1000 //写控制命令通道#define datare 0x1300 //读数据通道#define comre 0x1100 //读忙通道uchar code disp_data[] = // 数据表{0x00,0x01,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00 ,0x00,0x00,0x00,0x00,0x01,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00 ,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00 ,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00 ,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x00 ,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00 ,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x0 0,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x8 0,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF F,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0 3,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0 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x00,0x00,0x00,0x00,0x00,0x00,0 x3F,0xFF,0xC0,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,00xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0 x00,0x1F,0xFE,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x78,0x02,0x00,0x00,0x00,0x00,0 x00,0x0F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0x78,0x00,0x00,0x00,0x00,0 x00,0x02,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xF0,0x00,0x00,0x00,0x00, 0x00,0x00,0x7F,0xF0,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xC0,0x00,0x00,0x00,0x00, 0x00,0x00,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x80,0x00,0x00,0x00,0x00,0 x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x27,0xC0,0x00,0x00,0x00,0x00,0x00,0x01,0xFC,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x04,0x80,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0 x00,0x00,0x01};void set12864();void setxy(uchar x,uchar y);void write_command(uchar command);void write_16byte(uint data_add);void delays(uchar count);void main(){uchar x,y,i;while(1){y="0x80"; //设置液晶上半部分坐标x="0x80";delays(2); //延时2sset12864(); //初始化12864delays(2);for(i=0;i<32;i++) //写入液晶上半图象部分{ //写入坐标setxy(x,y);write_16byte(i*16); //连续写入16字节数据y++; //y轴地址加1}y="0x80"; //设置液晶下半部分坐标x="0x88";for(i=0;i<32;i++) //写入液晶下半图象部分{setxy(x,y); //写入坐标write_16byte((32+i)*16);//连续写入16字节数据y++; //y轴地址加1}write_command(0x34); //写入扩充指令命令write_command(0x36); //显示图象}}//初始化12864子程序void set12864(){write_command(0x30); //功能设定控制字write_command(0x0c); //显示开关控制字write_command(0x01); //清除屏幕控制字write_command(0x06); //进入设定点控制字}//设置绘图坐标void setxy(uchar x,uchar y){write_command(0x34); //写入扩充指令命令write_command(y); //写入y轴坐标write_command(x); //写入x轴坐标write_command(0x30); //写入基本指令命令}//写控制命令子程序void write_command(uchar command){bit flag="1"; //12864空闲标志位while(flag) //检查12864是否空闲flag="XBYTE"[comre]&0x80;XBYTE[comwr]=command; //空闲传送控制字}void write_16byte(uint data_add){bit flag="1"; //12864空闲标志位uchar num="16"; //16个循环,连续写入16个字节for(;num>0;num--){while(flag) //检查12864是否空闲flag="XBYTE"[comre]&0x80;XBYTE[datawr]=disp_data[data_add++]; //空闲传送数据}}//延时count秒子程序void delays(uchar count){unsigned char h,i,j,k;do{for(h=5;h>0;h--)for(i=4;i>0;i--)for(j=116;j>0;j--)for(k=214;k>0;k--);}while(--count);}圣斗士之家2009-07-28 23:13:30#include#include#define uchar unsigned char#define datawr 0x1200 //写数据通道#define comwr 0x1000 //写控制命令通道#define datare 0x1300 //读数据通道#define comre 0x1100; //读忙通道uchar code disp_data[]={" 浙江大学 " //第一行,第一页"04级通信工程一班" //第三行" 宁波理工学院 " //第二行" 竞赛小组 " //第四行"128X64液晶显示器" //第一行,第二页" 测试程序 " //第三行" 07年07月25日 " //第二行 " Tornado "}; //第四行void set12864();void write_command(uchar command);void write_page(uchar data_add);void read_page(uchar data_add);void delays(uchar cont);void main(){while(1){set12864(); //初始化12864write_page(0); //写入一页数据read_page(0x30); //读出一页数据到内部RAMdelays(2); //延时2swrite_page(64); //写入下一页数据delays(2); //延时2s}}//初始化12864子程序void set12864(){write_command(0x30); //功能设定控制字write_command(0x0c); //显示开关控制字write_command(0x01); //清除屏幕控制字write_command(0x06); //进入设定点控制字}//写控制命令子程序void write_command(uchar command){bit flag="1"; //12864空闲标志位while(flag) //检查12864是否空闲flag="XBYTE"[comre]&0x80;XBYTE[comwr]=command; //空闲传送控制字}//写一页子程序void write_page(uchar data_add){bit flag="1"; //12864空闲标志位uchar num="64"; //64个循环,连续写入32个汉字或是64个西文字符 write_command(0x80);for(;num>0;num--){while(flag)//检查12864是否空闲flag="XBYTE"[comre]&0x80;XBYTE[datawr]=disp_data[data_add++]; //空闲传送数据}}//读一页子程序void read_page(uchar data_add){bit flag="1"; //12864空闲标志位uchar num="64"; //64个循环,连续写入32个汉字或是64个西文字符 write_command(0x80);for(;num>0;num--){while(flag) //检查12864是否空闲flag="XBYTE"[comre]&0x80;DBYTE[data_add++]=XBYTE[datare]; //空闲传送数据}}//延时cont秒子程序void delays(uchar count){unsigned char h,i,j,k;do{for(h=5;h>0;h--)for(i=4;i>0;i--)for(j=116;j>0;j--)for(k=214;k>0;k--);}while(--count);}这是图象显示程序:#include#include#define uchar unsigned char#define uint unsigned int#define datawr 0x1200 //写数据通道#define comwr 0x1000 //写控制命令通道#define datare 0x1300 //读数据通道#define comre 0x1100 //读忙通道uchar code disp_data[] = // 数据表{0x00,0x01,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00, 0x00,0x00,0x01,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00, 0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x00, 0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00, 0x00,0x00,0x1F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00, 0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x80,0x00,0x00, 0x00,0x00,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF F,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF F,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x03,0xFF,0xF F,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x07,0xF F,0xFF,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x0 B,0xFF,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00, 0x1F,0x01,0xFF,0xFF,0xFF,0xFF,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x0 0,0x00,&nb14#inc lude <stdio.h>#inc lude <conio.h>int main(void){int c;int a;a = getchar();printf ("%c",a);/* Note that getc har reads from stdin andis line buffered; this means it w illnot return until you press ENTER. */while ((c = getc har()) != '\n'){printf("%c", c);}return 0;}注:可以利用getchar()函数让程序调试运行结束后等待编程者按下键盘才返回编辑界面,用法:在主函数结尾,return 0;之前加上getchar();即可getchar 的用途是从从标准输入流读取一个字符,读回车符时退出getchar();永远只向缓存中输入一个字符,getchar();的用法很多;一种就是清空回车符这种情况一般发生在在循环中涉及到输入的情况还有一种是某些编译平台(IDE)在运行程序时并没有在程序运行后给人看结果的时间这时候在程序最后加上getchar()就能造成程序的暂停给程序员度结果的机会用getchar时,在键盘上按一个字符后,要按回车才能读取进去;用getch时,在键盘上按一个字符马上就被读取进去,不用按回车,因此可以作为“按任意键继续”的执行语句。
LCD 模块使用手册EDM12864B图形点阵式液晶显示模块使用说明大连东福彩色液晶显示器有限公司1. 使用范围----------------------------------------------------32. 质量保证----------------------------------------------------33. 性能特点----------------------------------------------------34. 外形图-------------------------------------------------------75. I/O接口特性-----------------------------------------------76. 质量等级---------------------------------------------------137. 可靠性---------------------------------------------------158. 生产注意事项---------------------------------------------169. 使用注意事项---------------------------------------------171. 使用范围该检验标准适用于大连东福公司设计提供的标准液晶显示模块。
如果在使用中出现了异常问题或没有列明的项目,建议同最近的供应商或本公司联系。
2. 质量保证如在此手册列明的正常条件下使用、储存该产品,公司将提供12个月的质量保证。
3. 性能特点3-1.性能:显示方式 : 半透、正显STN LCD显示颜色 : 显示点: 深蓝色背景: 黄绿色显示形式: 128(w)×64 (h) 全点阵输入数据 : 来自MPU的8位串行数据接口Duty驱动路数: 1/64视角: 6 点3-2.机械性能:项目规格单位外形尺寸93.0 (W)×70.0(H) ×15.0Max.(T) Mm显示点阵数128 (W) ×64 (H) Dots —视域72.0(W) × 40.0 (H) Mm显示图形域66.52 (W) × 33.24 (H) Mm点间距0.48 (W) × 0.48 (H) Mm点尺寸0.44 (W) × 0.44 (H) Mm重量Approx. G3-3.极限参数:项目符号最小值最大值单位注释6.0V逻辑 Vdd电源电压Vee0 16.0 VLCD 驱动 Vdd–VVdd输入电压 Vi℃50操作温度 Top℃60储存温度 Tstg-20%RH90—湿度 —3-4. 电气特性:3-4-1 电气参数项 目 符 号 条 件 最小值典型值 最大值 单 位 逻辑 Vdd 4.5 5.0 5.5电源电压LCD 驱动 Vdd–Vee 14.5 — —高电平 Vih Vdd=5V ±5% 0.8Vdd — Vdd输入电压低电平 Vil 0 — 0.2VddV频 率 Fflm Vdd=5V 70 75 80 Hz逻辑 Idd — 1.6 2.0功 耗 LCD 驱动 Iee Vdd=5V Vdd–Vee= 12VFflm=75Hz— 0.15 0.2 mA Ta= 0℃φ=0°,θ=0°— 12.5 —Ta= 25℃φ=0°,θ=0°— 12.0 — LCD 驱动电压 (推荐电压) Vdd–Vee Ta= 50℃φ=0°,θ=0° — 11.5 —VNote: <1> 驱动路数=1/64<2> 所有点在静态条件下3-5. 电光特性项 目 符号温度 条件 最小值典型值最大值 单位 注释 0℃ — 5.2 6.025℃4.75.0 5.5 LCD 驱动电压(推荐电压) V LCD50℃ φ=0°,θ=0° 4.5 5.0 — V 1,2,5 0℃ — 1500 2000 上升时间tr 25℃ — 150 2000℃ — 3000 3500 响应 时间衰退时间 td25℃ φ=0°,θ=0°— 200 250Ms 1,3,5垂直 -35 — 35视 角Δφ 25℃水平 -30 — 30 deg. 1,4,5对比度 K 25℃ φ=0°,θ=0°2.0 5.0 — — 1,5,6注意:<1> φ和θ的定义<2> 在此电压范围内能获得对比度大于2(k≥2)注意:<4>视角定义注意:<5> 光学测量系统温度控制室(ΔΦ) ΔΦ=|Φ1-Φ2|非选择点的亮度(B2) 选择点的亮度(B1)非选择点的亮度(B1) 选择点的亮度(B2)4. 外形图5. I/O接口特性5-1. I/O 接口表:管脚号管脚名称电平功能描述1 VSS -- 电源地:0V2 VDD -- 电源电压: +5V3 VEE -- LCD驱动电压4 D/I H/LD/I=“H”时表示DB7~DB0为显示数据D/I=“L”时表示 DB7~DB0为指令数据5 R/W H/LR/W=“H”,E=“H” 数据读到DB7~DB0R/W=“L”,E=“H->L” 数据写到DB7~DB06 E H.H→ L使能信号: R/W=“L” E信号下降沿锁存DB7~DB0;R/W=“H” E=“H” DD RAM数据读到DB7~DB0 7-14 DB0~DB7-- 数据总线15 CS1 H/L高电平有效,CS1=1,CS2=0选择左半屏,相反则选右半屏16 CS2 H/L高电平有效,CS1=1,CS2=0选择左半屏,相反则选右半屏17 /RST 低电平时复位18 VEE LCD驱动电压19 BL+ 背光20 BL- 背光5-2.时序及时序图:1) 写操作时序2)读操作时序注: RS信号时序同D/I信号时序.3)接口时序参数名称符号最小值典型值最大值单位E周期时间Tcyc 1000 - - nsE高电平宽度Pweh 450 - - nsE低电平宽度Pwel 450 - - nsE上升时间Tr - - 25 ns E下降时间Tf - - 25 ns 地址建立时间Tas 140 - - ns 地址保持时间Tah 10 - - ns 数据建立时间Tdsw 200 - - ns数据延迟时间Tddr - - 320 ns 写数据保持时间Tdhw 10 - - ns 读数据保持时间Tdhr 20 - - ns5-3.电源连接图5-4. 电路图解LCD模块需逻辑电压(Vdd).注释: 当信号线直接连到C-MOS电路且没有内部上拉或下拉电阻时,有必要隔离外部干扰来保护信号线。
JEWEL HILL ELECTRONIC CO.,LTDJEWEL HILL ELECTRONIC CO.,LTD.SPECIFICATIONS FORLCD MODULEModule No. GB12864BOffice Address: Rm. 518,5/F., 101 Shangbu Industrial District,HuaqiangNorthRoad, Shenzhen, ChinaTEL : (86)-755-83362489 83617492FAX: (86)-755-83286396 83365871E-mail: sales@jhlcd@Website: TABLE OF CONTENTSLCM NUMBER SYSTEM (2)1. GENERAL DESCRIPTION (3)2. FEATURES (3)3. MECHANICAL SPECIFICATION (3)4. MECHANICAL DIMENSION (4)5. MAXIMUM RATINGS (5)6. ELECTRICAL CHARACTERISTICS (5)7. MODULE FUNCTION DESCRIPTION (6)8. ELECTRO-OPTICAL CHARACTERISTICS (12)9. RELIABILITY (16)10. PRECAUTIONS FOR USING LCD MODULES (17)11. USING LCD MODULES (19)12. REVISION HISTORY (21)SAMPLE APPROVED REPORT (22)LCM Number SystemNUMBER OF CHAR. PER LINE F: FSTN; X: OTHERVERSION NUMBER: V00~V99IC TYPE:VIEWING DIRECTION:TEMPERATURE RANGE:BACKLIGHT TYPE:SERIAL NUMBER: A~ZGRAPHIC MODULEs: NUMBER OF COMMONs GRAPHIC MODULEs:NUMBER OF SEGMENTs COB & SMT LCMBACKLIGHT COLOR:CHARACTER MODULEs:CHARACTER MODULEs: NUMBER OF LINE G: REFLECTIVE,NONE BACKLIGHT A: TRANSFLECTIVE, EL BACKLIGHT B: TRANSMISSIVE, EL BACKLIGHT C: TRANSFLECTIVE, LED BACKLIGHT D: TRANSMISSIVE, LED BACKLIGHT E: TRANSFLECTIVE, CCFL BACKLIGHT F: TRANSMISSIVE, CCFL BACKLIGHT A: AMBER; B: BLUE; Y: YELLOW-GREEN R: RED; W: WHITE; O: THER COLOR N: NORMAL TEMPERATURE RANGE U: UPPER(12:00); D: DOWN(6:00)L: LEFT(9:00); R: RIGHT(3:00);A: BONDING IC, WITH CONTROLLER B: BONDING IC, WITHOUT CONTROLLER C: SMT IC, WITH CONTROLLER D: SMT IC, WITHOUT CONTROLLER O: OTHER TYPEW: BLACK-WHITE; O: OTHER G: GRAY; Y: YELLOW-GREEN; B: BLUE; LCD COLOR MODE:N: TN; H: HTN; S: STN LCD TYPE:S: SUPER WIDE TEMPERATURE RANGE W: WIDE TEMPERATURE RANGEM: MIDDLE TEMPERATURE RANGE1. GENERAL DESCRIPTIONThe GB12864B is a 128 x 64 Dots Graphics LCD module. It has a STN panel composed of 128 segments and 64 commons. The LCM can be easily accessed by micro-controller via parallel interface.2. FEATURESTransflective and positiveDisplay ModeSTN(Yellow - Green) moduleDisplay Format Graphic 128 x 64 dotsInput Data Parallel data input from MPUMultiplexing Ratio 1/64DutyBiasBias 1/9Viewing Direction 6 O’clockBacklight LED3. MECHANICAL SPECIFICATIONItem Specifications Unit Dimensional outline 78.0 x 70.0 x 12.0(max) mmResolution 128segs x 64coms dotsActive area 56.28(W) x 38.26(H) mmDots pitch 0.44 (W)×0.6(H) mmDots size 0.4 (W)×0.56(H) mm4. MECHANICAL DIMENSION5. MAXIMUM RATINGSItem Symbol Min Max Unit NoteV DD - V ss -0.3 7.0 V Supply voltage V LCD -0.3 24.0 V Input Voltage V IN -0.3 V DD +0.3 VOperating temperature T OPR -10 +60 Storage temperature T STR -20 +70Humidity --- --- 90 %RH6. ELECTRICAL CHARACTERISTICSItem SymbolCondition Min. Typ. Max. UnitSupply Voltage Logic V DD------ 5.0 --- VH level V IH 0.8V DD --- V DDInput VoltageL levelV IL --- V SS --- 0.2V DDVCurrent Consumption(LCD DRIVER)I DD V DD =5.0V; V LCD =12.0V, T amb =25 ;--- --- 1.0 mALCD Driving Voltage V LCDBias=1/9V LCD =V DD -V EE9.3 9.8 10.2 VCurrent Consumption(With LED BackLight)I LEDV DD =5.0V;V LED =4.2V,T amb =25 ;--- --- 500 mA7. MODULE FUNCTION DESCRIPTION7.1. PIN DESCRIPTIONPin No. Symbol Description1 VSSPower supply for Ground (0V)2 VDDPower supply for positive (5V)3 V0LCD driver voltage regulation pin4 RSData/Instruction register selection H:DATA; L:Instruction5 RWRead/write selection signal, H: Read; L: Write6 ERead/write Enable signal input pin7 DB08 DB19 DB210 DB38-bit bi-directional data bus11 DB412 DB513 DB614 DB715 CSAChip select 1, High level is active16 CSBChip select 2, High level is active17 RSTReset signal input pin, Low level is active18 VEEPower supply for negative voltage19 LED+Power supply voltage for backlight positive20 LED-Power supply voltage for backlight negative7.2 TIMING CHARACTERISTICS1. SYSTEM BUS READ/WRITE CHARACTERISTIC2. DISPLAY CONTROL OUTPUT TIMING3. CLOCK TIMING7.3 CIRCUIT BLOCK DIAGRAM7.4 APPLICATION OF LCMReference circuit7.4 TABLE OF COMMAND8. ELECTRO-OPTICAL CHARACTERISTICSItem Symbol Condition Temp Min Typ. Max UnitsNote--- 10.2 ---25 9.3 9.8 10.2 LCD driving voltageV LCD = = 050 --- 9.5 ---- V NOTE1Rise Time (Tr) --- --- -- Decay Time (Tf)0 --- ---- --- Rise Time (Tr) --- 225 340Decay Time (Tf) 25 --- 240 360Rise Time (Tr) --- --- -- Response TimeDecay Time (Tf)= = 0 50 --- --- --msec NOTE2Contrast Ratio Cr= = 0 255 10 --- --- NOTE4Viewing AngleRange( = 0°)(6”) = 90°(3”) =180°(12”) =270°(9”)(25 ) CR ≥250 30 25 35DegNOTE3z For panel only․Electro-Optical Characteristics Measuring Equipment(DMS501)SystemIllumination (D65)․Note 1. Definition of Driving Voltage( Vlcd) :․Note 3. Definition of Viewing Angle and :․Note 4. Definition of Contrast ratio( CR) :Brightness of Non-selected Segment (B2)Brightness of Selected Segment (B1)CR =V,maxCR,maxDriving VoltageB r i gh t n e s s (%)Brightness Curve forSelected Segment0%=90 =270Viewing Direction 6 O’clock DirectionNormal :9. RELIABILITY9.1. MTBFThe LCD module shall be designed to meet a minimum MTBF value of 50000 hours with normal. (25°C in the room without sunlight)9.2. TESTSNO. ITEM CONDITION CRITERION1 High Temperature Operating 70 120Hrs2 Low Temperature Operating -20 120Hrs3High Temperature/Humidity Non-Operating70 ,90%RH ,120 Hrs4 High TemperatureNon-Operating80 120Hrs5 Low TemperatureNon-Operating-30 120Hrs6 Temperature CyclingNon-Operating-20 (30Min )↔ 70 (30Min)10 CYCLESNo Defect OfOperational Function InRoom Temperature AreAllowable.IDD of LCM inPre-and post-test shouldfollow specificationNotes: Judgments should be mode after exposure in room temperature for two hours.10. PRECAUTIONS FOR USING LCD MODULES10.1. HANDLING PRECAUTIONS(1) The display panel is made of glass. Do not subject it to a mechanical shock or impact by droppingit.(2) If the display panel is damaged and the liquid crystal substance leaks out, be sure not to get any inyour mouth. If the substance contacts your skin or clothes, wash it off using soap and water.(3) Do not apply excessive force to the display surface or the adjoining areas since this may cause thecolor tone to vary.(4) The polarizer covering the display surface of the LCD module is soft and easily scratched. Handlethis polarizer carefully.(5) If the display surface becomes contaminated, breathe on the surface and gently wipe it with a softdry cloth. If it is heavily contaminated, moisten a cloth with one of the following solvents: - Isopropyl alcohol- Ethyl alcohol(6) Solvents other than those above mentioned may damage the polarizer.Especially, do not use the following:- Water- Ketone- Aromatic solvents(7) Extra care to minimize corrosion of the electrode. Water droplets, moisture condensation or acurrent flow in a high-humidity environment accelerates corrosion of the electrode.(8) Install the LCD Module by using the mounting holes. When mounting the LCD Module, makesure it is free of twisting, warping and distortion. In particular, do not forcibly pull or bend the I/Ocable or the backlight cable.(9) Do not attempt to disassemble or process the LCD Module.(10) NC terminal should be open. Do not connect anything.(11) If the logic circuit power is off, do not apply the input signals.(12) To prevent destruction of the elements by static electricity, be careful to maintain an optimumwork environment.- Be sure to ground the body when handling he LCD Module.- Tools required for assembling, such as soldering irons, must be properly grounded.-To reduce the amount of static electricity generated, do not conduct assembling and other workunder dry conditions.-The LCD Module is coated with a film to protect the display surface. Exercise care when peeling off this protective film since static electricity may be generated.10.2. STORAGE CONDITIONSWhen storing, avoid the LCD module to be exposed to direct sunlight of fluorescent lamps. For stability, to keep it away form high temperature and high humidity environment (The best condition is : 23±5°C, 45±20%RH). ESD protection is necessary for long-term storage also.10.3. OTHERSLiquid crystals solidify under low temperature (below the storage temperature range) leading to defective orientation or the generation of air bubbles (black or white). Air bubbles may also be generated if the module is subject to a low temperature.If the LCD Module have been operating for a long time showing the same display patterns the display patterns may remain on the screen as ghost images and a slight contrast irregularity may also appear.A normal operating status can be recovered by suspending use for some time. It should be noted that this phenomenon does not adversely affect performance reliability.To minimize the performance degradation of the LCD Module resulting from destruction caused by static electricity etc. exercise care to avoid holding the following sections when handling the modules.- Exposed area of the printed circuit board.- Terminal electrode sections.11. Using LCD modules11.1 LIQUID CRYSTAL DISPLAY MODULESLCD is composed of glass and polarizer. Pay attention to the following items when handling.(1) Please keep the temperature within specified range for use and storage. Polarization degradation,bubble generation or polarizer peel-off may occur with high temperature and high humidity.(2) Do not touch, push or rub the exposed polarizers with anything harder than a HB pencil lead (glass,tweezers, etc).(3) N-hexane is recommended for cleaning the adhesives used to attach front/rear polarizers andreflectors made of organic substances, which will be damaged by chemicals such as acetone, toluene, toluene, ethanol and isopropyl alcohol.(4) When the display surface becomes dusty, wipe gently with absorbent cotton or other soft materiallike chamois soaked in petroleum ether. Do not scrub hard to avoid damaging the display surface.(5) Wipe off saliva or water drops immediately, contact with water over a long period of time maycause deformation or color fading.(6) Avoid contacting oil and fats.(7) Condensation on the surface and contact with terminals due to cold will damage, stain orpolarizers. After products are tested at low temperature they must be warmed up in a container before coming is contacting with room temperature air.(8) Do not put or attach anything on the display area to avoid leaving marks on.(9) Do not touch the display with bare hands. This will stain the display area and degrade insulationbetween terminals (some cosmetics are determinate to the polarizers).(10)As glass is fragile, it tends to become or chipped during handling especially on the edges. Pleaseavoid dropping or jarring.11.2 INSTALLING LCD MODULEAttend to the following items when installing the LCM.(1) Cover the surface with a transparent protective plate to protect the polarizer and LC cell.(2) When assembling the LCM into other equipment, the spacer to the bit between the LCM and thefitting plate should have enough height to avoid causing stress to the module surface, refer to the individual specifications for measurements. The measurement tolerance should be ±0.1mm.11.3 ELECTRO-STATIC DISCHARGE CONTROLSince this module uses a CMOS LSI, the same careful attention should be paid for electrostatic discharge as for an ordinary CMOS IC.(1) Make certain that you are grounded when handing LCM.(2) Before removing LCM from its packing case or incorporating it into a set, be sure the module andyour body have the same electric potential.(3) When soldering the terminal of LCM, make certain the AC power source for the soldering irondoes not leak.(4) When using an electric screwdriver to attach LCM, the screwdriver should be of groundpotentiality to minimize as much as possible any transmission of electromagnetic waves produced sparks coming from the commutator of the motor.(5) As far as possible, make the electric potential of your work clothes and that of the workbenches tothe ground potential.(6) To reduce the generation of electro-static discharge, be careful that the air in the work is not toodried. A relative humidity of 50%-60% is recommended.11.4 PRECAUTIONS FOR OPERATION(1) Viewing angle varies with the change of liquid crystal driving voltage (Vo). Adjust Vo to showthe best contrast.(2) Driving the LCD in the voltage above the limit will shorten its lifetime.(3) Response time is greatly delayed at temperature below the operating temperature range. However,this does not mean the LCD will be out of the order. It will recover when it returns to the specified temperature range.(4) If the display area is pushed hard during operation, the display will become abnormal. However, itwill return to normal if it is turned off and then on.(5) Condensation on terminals can cause an electrochemical reaction disrupting the terminal circuit.Therefore, this product must be used and stored within the specified condition of 23±5°C, 45±20%RH.(6) When turning the power on, input each signal after the positive/negative voltage becomes stable.11.5 SAFETY(1) It is recommended to crush damaged or unnecessary LCDs into pieces and wash them off withsolvents such as acetone and ethanol, which should later be burned.(2) If any liquid leaks out of a damaged glass cell and comes in contact with the hands, wash offthoroughly with soap and water.12. REVISION HISTORYrecord Date Version Reviseversion 05-01-011.0 Original2.0 Change specification format 05-11-203.0 Change contact mode 06-08-01SAMPLE APPROVED REPORT。
目录(一)概述(1)(二) 外形尺寸图(1)(三) 模块主要硬件构成说明(2)(四) 模块的外部接口(3)(五) 指令说明(4)(六) 读写操作时序(6)(七) 应用举例(7)一概述HS12864-1是一种图形点阵液晶显示器,它主要由行驱动器/列驱动器及格128 64全点阵液晶显示器组成可完成图形显示也可以显示8 4个(16 16点阵)汉字主要技术参数和性能1.电源VDD +5V 模块内自带-10V负压用于LCD的驱动电压2.显示内容128(列) 64(行)点3.全屏幕点阵4.七种指令5.与CPU接口采用8位数据总线并行输入输出和8条控制线6.占空比1/647.工作温度-10 +55 存储温度-20 +60二外形尺寸图1 外形尺寸图2 外形尺寸表 1ITEM NOMINAL DIMEN UNIT 模块体积113.0 65.0 11.0 mm视域73.4 38.8 mm 行列点阵数128 64 dots 点距离0.508 0.508 mm点大小0.458 0.458 mm三模块主要硬件构成说明(结构框图)注IC2控制模块的左半屏IC1控制模块的右半屏IC3为行驱动器IC1 IC2为列驱动器IC1 IC2 IC3含有以下主要功能器件了解如下器件有利于对LCD模块之编程1. 指令寄存器(IR)IR是用于寄存指令码与数据寄存器数据相对应当D/I=0时在E信号下降沿的作用下指令码写入IR2 数据寄存器(DR)DR是用于寄存数据的与指令寄存器寄存指令相对应当D/I=1时在下降沿作用下图形显示数据写入DR 或在E信号高电平作用下由DR读到DB7 DB0数据总线DR和DDRAM之间的数据传输是模块内部自动执行的3 忙标志BFBF标志提供内部工作情况BF=1表示模块在内部操作此时模块不接受外部指令和数据BF=0时模块为准备状态随时可接受外部指令和数据利用STATUS READ指令可以将BF读到DB7总线从检验模块之工作状态4 显示控制触发器DFF此触发器是用于模块屏幕显示开和关的控制 DFF=1为开显示DISPLAY OFF DDRAM的内容就显示在屏幕上DFF=0为关显示DISPLAY OFFDDF的状态是指令DISPLAY ON/OFF和RST信号控制的5 XY地址计数器XY地址计数器是一个9位计数器高3位是X地址计数器低6位为Y地址计数器XY地址计数器实际上是作为DDRAM的地址指针X地址计数器为DDRAM 的页指针Y地址计数器为DDRAM的Y地址指针X地址计数器是没有记数功能的只能用指令设置Y地址计数器具有循环记数功能各显示数据写入后Y地址自动加1 Y地址指针从0到636 显示数据RAM DDRAMDDRAM是存储图形显示数据的数据为1表示显示选择数据为0表示显示非选择DDRAM与地址和显示位置的关系见DDRAM地址表见第6页7 Z地址计数器Z地址计数器是一个6位计数器此计数器具备循环记数功能它是用于显示行扫描同步当一行扫描完成此地址计数器自动加1 指向下一行扫描数据RST复位后Z地址计数器为0Z地址计数器可以用指令DISPLAY START LINE预置因此显示屏幕的起始行就由此指令控制即DDRAM的数据从哪一行开始显示在屏幕的第一行此模块的DDRAM共64行屏幕可以循环滚动显示64行四模块的外部接口外部接口信号如下表2所示表 2管脚号管脚名称LEVER 管脚功能描述1 VSS 0 电源地2 VDD 5.0V 电源电压3 V0 5.0V -13V 液晶显示器驱动电压4 D/I H/L D/I= H 表示DB7 DB0为显示数据D/I= L 表示DB7 DB0为显示指令数据5 R/W H/L R/W= H E= H 数据被读到DB7 DB0R/W= L E= H L 数据被写到IR或DR6 E H/L R/W= L E信号下降沿锁存DB7 DB0R/W= H E= H DDRAM数据读到DB7 DB07 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 CS1 H/L H:选择芯片(右半屏)信号16 CS2 H/L H:选择芯片(左半屏)信号17 RET H/L 复位信号,低电平复位18 VEE -10V LCD驱动负电压19 EL AC LED背光板电源20 EL AC LED背光板电源五指令说明指令表表 3指指令码令R/W D/I D7 D6 D5 D4 D3 D2 D1 D0功能显示ON/OFF 0 0 0 0 1 1 1 1 1 1/0 控制显示器的开关不影响DDRAM中数据和内部状态显示起始行0 0 1 1 显示起始行0 63指定显示屏从DDRAM中哪一行开始显示数据设置X地址0 0 1 0 1 1 1 X 0 7 设置DDRAM中的页地址(X地址)设置Y地址0 0 0 1 Y地址0 63 设置地址(Y地址)读状态1 0 BUSYON/OFFRST0 0 0 0 读取状态RST 1:复位0:正常ON/OFF 1:显示开 0:显示关BUSY 0:READY 1:INOPERATION写显示数据0 1 显示数据将数据线上的数据DB7 DB0写入DDRAM读显示数据1 1 显示数据将DDRAM上的数据读入线数据DB7 DB01.显示开关控制(DISPLAY ON/OFF)代码R/W D/I DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 形式0 0 0 0 1 1 1 1 1 D D=1:开显示(DISPLAY ON)意即显示器可以进行各种显示操作D=0:关显示(DISPLAY OFF)意即不能对显示器可以进行各种显示操作2.设置显示起始行代码R/W D/I DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 形式0 0 1 1 A5 A4 A3 A2 A1 A0 前面在Z地址计数器一节已经描述了显示起始行是由Z地址计数器控制的 A5 A0的6位地址自动送入Z地址计数器起始行的地址可以是0 63 的任意一行例如选择A5 A0是62 则起始行与DDRAM行的对应关系如下DDRAM 行62 63 0 1 2 3 28 29 屏幕显示行 1 2 3 4 5 6 31 323.设置页地址代码R/W D/I DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 形式0 0 1 0 1 1 1 A2 A1 A0 所谓页地址就是DDRAM的行地址,8行为一页,模块共64行即8页, A2 A0表示0 7页读写数据对地址没有影响页地址由本指令或RST信号改变复位后页地址为0 页地址与DDRAM的对应关系见DDRAM地址表4.设置Y地址(SET Y ADDRESS)代码R/W D/I DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 形式0 0 0 1 A5 A4 A3 A2 A1 A0 此指令的作用是将A5 A0送入Y地址计数器,作为DDRAM的Y地址指针在对DDRAM进行读写操作后Y地址指针自动加1 指向下一个DDRAM 单元DDRAM地址表表 4CS2=1 CS1=1Y= 0 1 62 63 0 1 62 63 行号DB0 DB0 DB0 DBO DBO DBO DBO DBO DBO DBO 0X=0 DB7 DB7 DB7 DB7 DB7 DB7 DB7 DB7 DB7 DB7 7 DB0 DB0 DB0 DB0 DB0 DB0 DB0 DB0 DB0 DB0 8DB7 DB7 DB7 DB7 DB7 DB7 DB7 DB7 DB7 DB7 55 X=7 DB0 DBO DBO DBO DBO DBO DBO DBO DBO DBO 56DB7 DB7 DB7 DB7 DB7 DB7 DB7 DB7 DB7 DB7 635.读状态(STATUS READ)代码R/W D/I DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0RET 0 0 0 0 形式0 1 BUSY 0 ON/OFF当R/W=1 D/I=0时在E信号为H 的作用下状态分别输出到数据总线DB7 DB0 的相应位BF 前面已叙述过见BF标志位一节ON/OFF 表示DFF触发器的状态见DFF触发器一节RST RST=1表示内部正在初始化此时组件不接受任何指令和数据6.写显示数据(WRITE DISPLAY DATE)代码R/W D/I DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 形式0 1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D0为显示数据,此指令把D7 D0写入相应的DDRAM单元Y地指针自动加17.读显示数据(READ DISPLAY DATE)代码R/W D/I DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 形式 1 1 D7 D6 D5 D4 D3 D2 D1 D0 此指令把DDRAM的内容D7 D0读到数据总线DB7 DB0 Y地址指针自动加1六读写操作时序1.写操作时序图 32.读操作时序图 43.读写时序参数表表 5名称符号最小值典型值最大值单位E周期时间Tcyc 1000 --- --- ns E高电平宽度Pweh 450 --- --- ns E低电平宽度Pwel 450 --- --- ns E上升时间Tr --- --- 25 ns E下降时间Tf --- --- 25 ns 地址建立时间Tas 140 --- --- ns 地址保持时间Tah 10 --- --- ns 数据建立时间Tdsw 200 --- --- ns 数据延迟时间Tddr --- --- 320 ns 写数据保持时间Tdhw 10 --- --- ns 读数据保持时间Tdhw 20 --- --- ns七应用举例HS12864-1与单片机8031的一种接口如图5.所示图 5利用图5举例介绍编程实例ORG 0000HLJMP INITMORG 0100HINITM MOV SP #67H SET STACK ADDRESSMOV DPTR #3800H SELECT CHIP1 AND CHIP2MOV A #3EH OFF DISPLAYLCALL OUTILCALL MS40LCALL MS40LCALL MS40MOV A #3FH ON DISPLAYLCALL OUTILCALL MS40LCALL MS40LCALL MS40显示* 号MOV R3 #04H PAGE NUMBER 2*4=8PAGES MOV A #0B8H PAGE0DISP1 PUSH ACCLCALL CHIN1POP ACCINC AINC ADJNZ R3 DISP1LCALL MS40LCALL MS40LCALL MS40LCALL MS40LCALL MS40显示竖条MOV R3 #04HMOV A #0B8H DISP2 PUSH ACCLCALL CHIN2 POP ACCINC AINC ADJNZ R3 DISP2 LCALL MS40LCALL MS40LCALL MS40LCALL MS40LCALL MS40显示横条MOV R3 #04HMOV A #0B8H DISP3 PUSH ACCLCALL CHIN3 POP ACCINC AINC ADJNZ R3 DISP3 LCALL MS40LCALL MS40LCALL MS40LCALL MS40LCALL MS40显示汉字MOV R3 #04HMOV A #0B8H DISP4 PUSH ACCLCALL CHIN4 POP ACCINC AINC ADJNZ R3 DISP4LCALL MS40LCALL MS40LCALL MS40LCALL MS40LCALL MS40LJMP INITMCHIN1 PUSH ACC PUT A PAGE NUMBER INTO STACK LCALL OUT1MOV A #40H SET Y ADDRESSLCALL OUTIMOV R2 #32LOAD1 MOV A #55HLCALL OUTDMOV A #0AAHLCALL OUTDDJNZ R2 LOAD1POP ACCINC ALCALL OUTIMOV A #40HLCALL OUTIMOV R2 #32LOAD12 MOV A #55HLCALL OUTDMOV A #0AAHLCALL OUTDDJNZ R2 LOAD12RETCHIN2 PUSH ACC PUT A PAGE NUMBER INTO STACK LCALL OUT1MOV A #40H SET Y ADDRESSLCALL OUTIMOV R2 #32LOAD2 MOV A #00HLCALL OUTDMOV A #0FFHLCALL OUTDDJNZ R2 LOAD2POP ACCINC ALCALL OUTILCALL OUTIMOV R2 #32LOAD21 MOV A #00HLCALL OUTDMOV A #0FFHLCALL OUTDDJNZ R2 LOAD21RETCHIN3 PUSH ACC PUT A PAGE NUMBER INTO STACK LCALL OUT1MOV A #40H SET Y ADDRESSLCALL OUTIMOV R2 #64LOAD3 MOV A #55HLCALL OUTDDJNZ R2 LOAD3POP ACCINC ALCALL OUTIMOV A #40HLCALL OUTIMOV R2 #64LOAD31 MOV A #55HLCALL OUTDDJNZ R2 LOAD31RETCHIN4 PUSH ACCLCALL OUT1MOV A #40HLCALL OUTIMOV R2 #64MOV R1 #00HMOV DPTR #CHINESELOAD4 MOV A R1MOVC A @A+DPTRLCALL OUTDINC DPTRDJNZ R2 LOAD4POP ACCINC ALCALL OUTILOAD41 MOV A R1MOVC A @A+DPTRLCALL OUTDINC DPTRDJNE R2 LOAD41RETMS40 MOV R7 #0E8HMS2 MOV R6 #0FFHMS1 DJNZ R6 MS1DJNZ R7 MS2RETOUT INSTRCTION FOR CHIP1 AND CHIP2OTUI PUSH DPHPUSH DPLMOV DPTR #3800HMOVX @A+DPTR APOP DPLPOP DPHRETOUTD PUSH DPHPUSH DPLMOV DPTR #7800MOVX @DPTR APOP DPLPOP DPHRETCHINNESE PAGE0DB 10H 60H 01H 86H 60H 04H 1cH e4H 04H 04H 04H E4H 1cH 04H 00H 00DB 00H 00H 80H 9fH 95H d5H 55H 55H 55H 15H d5H 15H 1fH00H 00H 00DB 10H 61H 06H E0H 18H 84H, E4H 1CH 84H 65H BEH 24H 0A4H, 64H,04H 00DB 00H 00H 00H 00H 7EH 2AH 2AH 2AH 2AH 2AH 2AH 7EH 00H00H 00H 00PAGE1DB 04 04H 7eH 01H 40H 20H 20H 10H 0bH 04H 0bH 10H 30H 60H 20H 00DB 02 02H 42H 22H 1aH 07H 02H 02H 02H 02H 0ffH 02H 02H 02H,02H 00HDB 04H 04H 0FFH 00H 00H 00H FFH 41H 21H 12H 0CH 1BH 61H 0C0H, 40H 00DB 00H 7FH 25H 25H 25H 25H 7FH 00H 00H 7FH 25H 25H 25H25H 7FH 00H。
/*12864zw 实例教程,包括自定义字符,图片显示等等*/#include<reg52.h>#include <intrins.h>sbit RS=P2^2;//串口时为CSsbit RW=P2^3; //串口为SIDsbit E=P2^4; //串口为时钟SCLK //sbit stop=P3^2;sbit PSB=P2^5;sbit REST=P2^7;//以下是用<at89x51.h>头文件的定义/* #define RS P2_0#define RW P2_3 //定义引脚#define E P2_4 #define PSB P2_3#define REST P2_7#define Data P0#include<at89x51.h> */#define BF 0x80//用于检测LCM状态字中的Busy标识typedef unsigned int Uint;typedef unsigned char Uchar;//字符串例子//"F1--English",也可以往里面写入汉字码,一个汉字由两个码组成const Uchar F1English[]={0x46,0x31,0x2d,0x2d,0x45,0x6e,0x67,0x6c,0x69,0x73,0x68, 0x00}; const Uchar lengthF1=6; //字符串长度//汉字,直接可以写入字形unsigned char code uctech[] = {"曾小贤愚人节快乐"};const Uchar lengthCF3=8;Uchar code TAB1[]={/*-- 调入了一幅图像:C:\Documents and Settings\Administrator\桌面\12864.bmp --*//*-- 宽度x高度=128x64 --*/0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xBF,0xFF,0xF F,0xFF,0xFF,0xFF,0xC0,0x01,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF ,0xFF,0xFE,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF, 0xF8,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0xE0,0 x00,0x00,0x0F,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x 00,0x0F,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xBF,0xFF,0xFF,0xFF,0xFF,0x80,0x04,0x00,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0x00,0x00,0x08,0xD7,0xFF,0xFF,0xF8,0x00,0x21,0x01,0x80,0 x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0xF F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,};//这个是在串口时指令和数据之间的延时/*void delay10US(Uchar x){Uchar k;for(k=0;k<x;k++);}*/const Uchar delay=250; //延时时间常数static void Wait1ms(void)//延迟1 ms{Uchart=0;while (cnt<delay)t++;}//延迟n msvoid WaitNms(int n){Uchar i;for(i=1;i<=n;i++)Wait1ms();}void ini_int1(void){EA=1;EX0=1;//允许外部INT0的中断IT0=1;// 允许中断}int scankey1() interrupt 2 using 3 //使用外部中断1,寄存器组3{while(P3^2==0){for(;;);}IE1=0;//中断标志清零}//**************************************************************************// //以下是并口时才开的//读忙标志,void RDBF(void){Uchar temp;RS=0; // RS=0RW=1; // RW=1while(1){P0=0xFF; //数据线为输入E=1;temp=P0;E=0; // E=0if ((temp&0x80)==0) break;}}//写数据到指令寄存器void WRCommand(Uchar comm){RDBF();RS=0;RW=0;P0=comm;E=1;E=0;}//写数据到数据寄存器void WRData(Uchar TEMP){RDBF();RS=1;RW=0;P0=TEMP;E=1;E=0;//stopint();}///////////////////////////////////////////////////////////////////////////////////以下是串口时开的读写时序/*void SendByteLCD(Uchar WLCDData){Uchar i;for(i=0;i<8;i++){if((WLCDData<<i)&0x80)RW=1;else RW=0;E=0;E=1;}}SPIWR(Uchar Wdata,Uchar WRS){SendByteLCD(0xf8+(WRS<<1));SendByteLCD(Wdata&0xf0);SendByteLCD((Wdata<<4)&0xf0);}void WRCommand(Uchar CMD){RS=0;RS=1;SPIWR(CMD,0);delay10US(90);//89S52来模拟串行通信,所以,加上89S52的延时,}void WRData(Uchar Data){RS=0;RS=1;SPIWR(Data,1);}*//*******************************************************************/ //初始化LCD-8位接口void LCDInit(void){// PSB=0; //串口PSB=1;//并口时选这个,上一行取消REST=1;REST=0;REST=1;WRCommand(0x30); //基本指令集,8位并行WRCommand(0x06); //启始点设定:光标右移WRCommand(0x01); //清除显示DDRAMWRCommand(0x0C); //显示状态开关:整体显示开,光标显示关,光标显示反白关WRCommand(0x02); //地址归零}//显示数组字符串(显示半宽字型16*8点阵)void ShowQQChar(Uchar addr,Uchar *english,Uchar count){Uchar i;WRCommand(addr); //设定DDRAM地址for(i=0;i<count;){WRData(english[i*2]);WRData(english[i*2+1]);i++;}}//显示连续字串(半宽字符)void ShowNUMChar(Uchar addr,Uchar i,Uchar count){Uchar j;for(j=0;j<count;){WRCommand(addr); //设定DDRAM地址WRData(i+j);j++;WRData(i+j);addr++;j++;}}//自定义字符写入CGRAMvoid WRCGRAM(Uchar data1,Uchar data2,Uchar addr){Uchar i;for(i=0;i<16;){WRCommand(addr+i); //设定CGRAM地址WRData(data1);WRData(data1);i++;WRCommand(addr+i); //设定CGRAM地址WRData(data2);WRData(data2);i++;}}//显示自定义的字符,并把这个字符填满全屏16*16void ShowCGChar(Uchar addr,Uchar i){Uchar j;for(j=0;j<0x20;){WRCommand(addr+j); //设定DDRAM地址WRData(0x00);WRData(i);j++;}}void CLEARGDRAM(void){Uchar j;Uchar i;WRCommand(0x34);WRCommand(0x36);for(j=0;j<32;j++){WRCommand(0x80+j);WRCommand(0x80);//X坐标for(i=0;i<32;i++)//{WRData(0x00);}}}//写入GDRAM 绘图,Y是Y绘图坐标,2个字节一行,CLONG是图形长度,以字节//为单位;HIGHT是图形高度,TAB是图形数据表.12864M的图形显示是相当于256*32点阵. //由两屏128*32上下两屏组成,同一行的下屏的头地址紧接上屏的未地址。