完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
【25632液晶显示屏试用体验】四、理解块和page,驱显LCD
先将现在理解的驱显原理用图例说明,手册也是这么说的,我在大白话重复一遍:屏幕分成4个块ABCD,每个块可以用pagex来描述,也可以 用行列直来描述。本例采用ASCII码显示,因此用page描述更好,因为1个page是8个像素高,一行是64个像素只好可以放8X8点阵的ASCII码8个。见图41。 这个屏的手册中没有初始化函数,参照原来给的初始化照搬了过来,增加了Reset一行。基于Nuvoton ARM0的M0516的代码如下: #include "common.h" #include #define clk P01_DOUT//Clock #define rwc P02_DOUT//R/W LCD #define cs1 P03_DOUT//Chip Select1 #define cs2 P04_DOUT//Chip Select1 #define reg P05_DOUT//1=Data & 0=Command #define res P06_DOUT//LCD Reset #define dataIn P2_DOUT const unsigned char asc2[][8]={//ASCII Table {0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00},//"0",0 {0x00,0x44,0x44,0x7E,0x40,0x40,0x00,0x00},//"1",1 {0x00,0x44,0x62,0x62,0x52,0x4A,0x64,0x00},//"2",2 {0x00,0x24,0x42,0x4A,0x4A,0x4A,0x34,0x00},//"3",3 {0x00,0x10,0x28,0x24,0x62,0x7E,0x00,0x00},//"4",4 {0x00,0x2E,0x4A,0x4A,0x4A,0x4A,0x32,0x00},//"5",5 {0x00,0x3C,0x4A,0x4A,0x4A,0x4A,0x30,0x00},//"6",6 {0x00,0x06,0x02,0x72,0x0A,0x06,0x02,0x00},//"7",7 {0x00,0x34,0x4A,0x52,0x52,0x5A,0x24,0x00},//"8",8 {0x00,0x0C,0x52,0x52,0x52,0x74,0x3C,0x00},//"9",9 {0x40,0x60,0x78,0x26,0x2C,0x70,0x60,0x40},//"A",10 {0x42,0x7E,0x4A,0x4A,0x4A,0x56,0x30,0x00},//"B",11 {0x3C,0x64,0x42,0x42,0x42,0x42,0x26,0x00},//"C",12 {0x42,0x7E,0x42,0x42,0x42,0x24,0x3C,0x00},//"D",13 {0x42,0x7E,0x4A,0x4A,0x5E,0x42,0x42,0x00},//"E",14 {0x42,0x7E,0x4A,0x0A,0x1E,0x02,0x02,0x00},//"F",15 {0x3C,0x64,0x42,0x42,0x52,0x36,0x10,0x00},//"G",16 {0x42,0x7E,0x52,0x10,0x10,0x52,0x7E,0x42},//"H",17 {0x00,0x42,0x42,0x7E,0x42,0x42,0x00,0x00},//"I",18 {0x80,0x80,0x82,0x82,0x7E,0x02,0x02,0x00},//"J",19 {0x42,0x7E,0x4A,0x1E,0x76,0x62,0x42,0x00},//"K",20 {0x42,0x7E,0x42,0x40,0x40,0x40,0x40,0x00},//"L",21 {0x42,0x7E,0x0E,0x70,0x0E,0x7E,0x42,0x00},//"M",22 {0x42,0x7E,0x44,0x08,0x10,0x22,0x7E,0x02},//"N",23 {0x3C,0x26,0x42,0x42,0x42,0x66,0x3C,0x00},//"O",24 {0x42,0x7E,0x4A,0x0A,0x0A,0x0A,0x04,0x00},//"P",25 {0x3C,0x46,0x62,0x62,0x42,0xC6,0xBC,0x00},//"Q",26 {0x42,0x7E,0x4A,0x0A,0x1A,0x2A,0x66,0x40},//"R",27 {0x00,0x64,0x4A,0x4A,0x52,0x52,0x26,0x00},//"S",28 {0x02,0x02,0x42,0x7E,0x42,0x02,0x02,0x00},//"T",29 {0x02,0x7E,0x42,0x40,0x40,0x42,0x3E,0x02},//"U",30 {0x02,0x06,0x3A,0x40,0x30,0x1A,0x06,0x02},//"V",31 {0x1E,0x62,0x30,0x0E,0x30,0x62,0x1E,0x00},//"W",32 {0x42,0x46,0x66,0x18,0x1A,0x66,0x62,0x42},//"X",33 {0x02,0x06,0x4A,0x78,0x4E,0x06,0x02,0x00},//"Y",34 {0x42,0x62,0x72,0x5A,0x4E,0x46,0x42,0x00},//"Z",35 {0x00,0x00,0x00,0x48,0x48,0x00,0x00,0x00},//":",36 {0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x00},//"=",37 {0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08},//"-",38 {0x08,0x08,0x08,0x3E,0x08,0x08,0x08,0x00},//"+",39 {0x00,0x80,0x40,0x20,0x18,0x04,0x02,0x01},//"/",40 {0x3C,0x64,0x42,0x42,0x52,0x36,0x10,0x00},//"G",16 {0x42,0x7E,0x52,0x10,0x10,0x52,0x7E,0x42},//"H",17 {0x00,0x42,0x42,0x7E,0x42,0x42,0x00,0x00},//"I",18 {0x80,0x80,0x82,0x82,0x7E,0x02,0x02,0x00},//"J",19 {0x42,0x7E,0x4A,0x1E,0x76,0x62,0x42,0x00},//"K",20 {0x42,0x7E,0x42,0x40,0x40,0x40,0x40,0x00},//"L",21 {0x42,0x7E,0x0E,0x70,0x0E,0x7E,0x42,0x00},//"M",22 {0x42,0x7E,0x44,0x08,0x10,0x22,0x7E,0x02},//"N",23 {0x3C,0x26,0x42,0x42,0x42,0x66,0x3C,0x00},//"O",24 {0x42,0x7E,0x4A,0x0A,0x0A,0x0A,0x04,0x00},//"P",25 {0x3C,0x46,0x62,0x62,0x42,0xC6,0xBC,0x00},//"Q",26 {0x42,0x7E,0x4A,0x0A,0x1A,0x2A,0x66,0x40},//"R",27 {0x00,0x64,0x4A,0x4A,0x52,0x52,0x26,0x00},//"S",28 {0x02,0x02,0x42,0x7E,0x42,0x02,0x02,0x00},//"T",29 {0x02,0x7E,0x42,0x40,0x40,0x42,0x3E,0x02},//"U",30 {0x02,0x06,0x3A,0x40,0x30,0x1A,0x06,0x02},//"V",31 {0x1E,0x62,0x30,0x0E,0x30,0x62,0x1E,0x00},//"W",32 {0x42,0x46,0x66,0x18,0x1A,0x66,0x62,0x42},//"X",33 {0x02,0x06,0x4A,0x78,0x4E,0x06,0x02,0x00},//"Y",34 {0x42,0x62,0x72,0x5A,0x4E,0x46,0x42,0x00},//"Z",35 {0x00,0x00,0x00,0x48,0x48,0x00,0x00,0x00},//":",36 {0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x00},//"=",37 {0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x08},//"-",38 {0x08,0x08,0x08,0x3E,0x08,0x08,0x08,0x00},//"+",39 {0x00,0x80,0x40,0x20,0x18,0x04,0x02,0x01} //"/",40 }; //Delayer void delay(int xms){ int i,j; for(i=0;i //Write 1Byte to LCD void d2l(unsigned char dd,unsigned char com){ rwc=0; reg=com; dataIn=dd; clk=1;delay(1);clk=0; rwc=1; } //Set PAGEs void setPage(unsigned char pag){ d2l(0xB8 | pag,0); } //Set Col Row void setCR(unsigned char area1,unsigned char area2){ cs1=area1;cs2=area2; } //Write A ASCII to LCD void c2l(unsigned char x,unsigned char y,unsigned char c){ int i; setCR(x,y); for (i=0;i<8;i++){d2l(asc2[c],1);} } //LCD Clear void lcdClear(unsigned char a,unsigned char b){ int i,j; for(j=0;j<8;j++){ setCR(1,0); setPage(j); setCR(0,1); setPage(j); for (i=0;i<32;i++){ setCR(1,0); d2l(a,1); setCR(0,1); d2l(a,1); setCR(1,0); d2l(b,1); setCR(0,1); d2l(b,1); } } } void lcdInit(void){ res=1; delay(1000); setCR(0,0); setCR(1,0); d2l(0x00,0);//left screen write setCR(0,1); d2l(0x00,0);//right screen write //on display setCR(1,0); d2l(0x3F,0);//middle screen write setCR(0,1); d2l(0x3F,0);//right screen write //set start address setCR(1,0); d2l(0xC0,0);//middle screen write setCR(0,1); d2l(0xC0,0);//right screen write //write display snap setCR(1,0); d2l(0xB8,0);//middle screen write setCR(0,1); d2l(0xB8,0);//right screen write //set seg register setCR(1,0); d2l(0x40,0);//middle screen write setCR(0,1); d2l(0x40,0);//right screen write } //Main Program int main(void){ int i,j; lcdInit(); lcdClear(0x00,0x00); while(1){ lcdInit(); lcdClear(0x00,0x00); delay(2); //Output ASCII to LCD //A Block for(j=0;j<4;j++){ setCR(1,0); setPage(j); for(i=0;i<8;i++){c2l(1,0,i+j*8);} } //C Block for(j=4;j<8;j++){ setCR(1,0); setPage(j); for(i=0;i<8;i++){c2l(1,0,i+j*8);} } //B Block for(j=0;j<4;j++){ setCR(0,1); setPage(j); for(i=0;i<8;i++){c2l(0,1,i+j*8);} } //D Block for(j=4;j<8;j++){ setCR(0,1); setPage(j); for(i=0;i<8;i++){c2l(0,1,i+j*8);} } delay(8000); } } 驱显结果见照片41,42。 经过试用,最后对GXM25632-11DS4NL7V1R显示模块的评价是: 1. 屏幕够大,8X8点阵ASCII码可以显示的数量尽管与128X64的一样多,当横向显示比较适应特定场合和喜欢横向一眼扫尽的人群。 2. 在实际5V状况下的显示清晰和对比度还是足够好的,亮度也够。刷屏速度够用,清除时略能看到屏变——清除的效果。 3. 手册与实际的屏幕给的参数不一致,主要是指极限电压的3.3V和实际工作电压5V!这是最大的问题。 4. 如果3.3V下能正常显示,但必须加VEE的负压—— -12V,作为实验是十分危险的,也是不可取的。产品可以这样。不过人文化一点,既然已经是模块了,问什么不做一块负压芯片在上边,页增加不了多少成本的,但带来使用者的方便和产品安全性确实很大的,这是以最大的问题! 5. 其次引脚逻辑没有印字是另外一大败笔。 整体感觉,做产品可能需要设计负压,带来PCB板的布局考验和使用环境的挑战[-12V];做实验,是危险的,因为杜邦线的一不注意就会悲了催了的。 希望产品厂家改进,至少将忽略无意的印字和负压改掉还是可以用的。
|
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
请问OLED显示屏可以让整帧画面同一时间显示出来吗,而不是行扫?
10208 浏览 1 评论
8258 浏览 3 评论
动手做:使用 LED 灯带第 1 部分 – 制作住宅柜下照明
7071 浏览 3 评论
11223 浏览 13 评论
9092 浏览 2 评论
692浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 13:14 , Processed in 0.523180 second(s), Total 74, Slave 54 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号