01
物联网系统中为什么要使用点阵液晶屏
物联网系统中使用点阵液晶屏的原因主要可以归纳为以下几点:
显示内容丰富多样
适应性强
低功耗与长寿命
易于控制与维护
提升用户体验
综上所述,点阵液晶屏在物联网系统中的应用具有显著的优势,能够满足物联网设备对显示内容丰富性、适应性、低功耗、长寿命以及易于控制与维护等方面的需求,从而提升物联网系统的整体性能和用户体验。
本文会再为大家详解显示屏家族中的一员——点阵液晶屏。
02
点阵液晶屏的定义
点阵液晶屏是按照一定顺序规则排列起来的,一般常见的有图形点阵液晶模块。他里面是有很多个点组成的,通过控制这些点来显示文字或者图形,并且可以实现出屏幕上下左右滚动以及动画功能。(如下图)LCD12864图形点阵液晶显示模块(LCM)就是由128*64个液晶显示点组成的一个128列*64行的阵列,它的每一行横向一共有128个可显示点,每一列纵向有64个,这些“点”其实也都是一个个发光二极管,每个显示点对应一位二进制数,1表示亮,0表示灭。
03
点阵液晶屏的显示原理
1、系统12864点阵型液晶显示屏的基本原理
数字电路中数据以0和1保存,对LCD控制器进行不同的数据操作,可以得到不同的结果。对于显示英文操作,由于英文字母种类少只需要8位(一字节)即可。而对于中文,常用却有6000以上,于是我们的DOS前辈想了一个办法,就是将ASCII表的高128个很少用到的数值以两个为一组来表示汉字,即汉字的内码。而剩下的低128位则留给英文字符使用,即英文的内码。
得到了汉字的内码后,利用文字的字模,即用数字的各位信息来记载英文或汉字的形状,如英文的'A'在字模的记载方式如图1所示:
2、汉字图形点阵液晶显示模块(QC12864B)主要技术参数和显示特性:
① QC12864B汉字图形点阵液晶显示模块,可显示汉字及图形
② 内置 8192个中文汉字(16X16点阵)、128个字符(8X16点阵)及 64X256点阵显示 RAM(GDRAM)
③ 电源:VDD 3.3V~+5V(内置升压电路,无需负压);显示内容:128列× 64 行
④ 显示颜色:黄绿屏,蓝屏
⑤ 显示角度:6:00钟直视
⑥ LCD类型:STN
⑦ 与 MCU接口:8位并口或串行配置 LED背光
⑧ 多种软件功能:光标显示、画面移位、自定义字符、睡眠模式等
3、QC12864B读写操作时序:
模块有并行和串行两种连接方法(时序如下):8 位并行连接时序图
MPU 写资料到模块如图4所示:
图4 MPU写资料到模块图
图5 MPU从模块读出资料图
串行连接时序图
串行数据传送共分三个字节完成:
第一字节:串口控制—格式11111ABC
① A 为数据传送方向控制:H 表示数据从 LCD 到 MCU,L 表示数据从 MCU 到 LCD
② B 为数据类型选择:H 表示数据是显示数据,L 表示数据是控制指令
③ C 固定为 0
第二字节: (并行)8 位数据的高 4 位—格式 DDDD0000
第三字节: (并行)8 位数据的低 4 位—格式 0000DDDD 串行接口时序参数:(测试条件:T=25℃ VDD=5.0V)
4、QC12864B点阵型LCD引脚功能说明:
表1 12864LCD的引脚说明
管脚号 | 管脚名称 | LEVER | 管脚功能描述 |
1 | VSS | 0 | 电源地 |
2 | VDD | +5.0V | 电源电压 |
3 | V0 | - | 液晶显示器驱动电压 |
4 | D/I(RS) | H/L | D/I=“H”,表示DB7∽DB0为显示数据 D/I=“L”,表示DB7∽DB0为显示指令数据 |
5 | R/W | H/L | R/W=“H”,E=“H”数据被读到DB7∽DB0 R/W=“L”,E=“H→L”数据被写到IR或DR |
6 | E | H/L | R/W=“L”,E信号下降沿锁存DB7∽DB0 R/W=“H”,E=“H”DDRAM数据读到DB7∽DB0 |
7 | DB0-DB7 | H/L | 数据线 |
8 | CS1 | H/L | H:选择芯片(左半屏)信号 |
9 | CS2 | H/L | H:选择芯片(右半屏)信号 |
10 | RET | H/L | 复位信号,低电平复位 |
11 | VOUT | -10V | LCD驱动负电压 |
12 | LED+ | - | LED背光板电源 |
13 | LED- | - | LED背光板电源 |
说明:12864点阵型液晶 C语言程序(可根据自己意愿设定指定点)
/****电子系统设计C51编程******
************/
#include
#include
#define uchar unsigned char
#define uint unsigned int
/*12864端口定义*/
#define LCD_data P0 //数据口
sbit LCD_RS = P1^0; //寄存器选择输入
sbit LCD_RW = P1^1; //液晶读/写控制
sbit LCD_EN = P2^5; //液晶使能控制
sbit LCD_PSB = P1^2; //串/并方式控制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0xFF,0xFF,0xE7,0x87,0x3D,0xC7,0x7D,0xB0,0x89,0x00,0x00,0x03,0xFF,0xE0,0xF8,
0xFF,0xFF,0xFF,0xE7,0x87,0x01,0x87,0x7C,0x30,0x08,0x1F,0x00,0x03,0xFD,0xFF,0xF8,
0xFF,0xFF,0xFF,0xF7,0x87,0xC1,0x07,0x60,0xF0,0x10,0x3F,0xFF,0xDB,0xFF,0xFF,0xF0,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x07,0x63,0xF4,0x30,0x3F,0xFF,0xDF,0xFF,0xFF,0xF0, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,0x04,0x70,0x3F,0xFF,0xD7,0xFE,0xFF,0xE0, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x01,0xF0,0x3F,0xFF,0xD7,0xFE,0xFF,0xE0,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x40,0x1F,0xF0,0x00,0x3F,0xE7,0xFE,0x00,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF1,0x00,0x00,0xE7,0xFE,0x00,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,0x07,0xFE,0x00,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x07,0xFE,0x00,0x00
};
#define delayNOP(); {_nop_();_nop_();_nop_();_nop_();};
void delay0(uchar x); //x*0.14MS
void dataconv();
void lcd_pos(uchar X,uchar Y); //确定显示位置
void delay(int ms)
{ while(ms--)
{
uchar i;
for(i=0;i<250;i++)
{ _nop_();_nop_();_nop_();_nop_(); }
}
}
/*************/
/* */
/*检查LCD忙状态 */
/*lcd_busy为1时,忙,等待。lcd-busy为0时,闲,可写指令与数据。 */
/* */
/*************/
bit lcd_busy()
{ bit result;
LCD_RS = 0;
LCD_RW = 1;
LCD_EN = 1;
delayNOP();
result = (bit)(P0&0x80);
LCD_EN = 0;
return(result);
}
/*************/
/*写指令数据到LCD */
/*RS=L,RW=L,E=高脉冲,D0-D7=指令码。 */
/*************/
void lcd_wcmd(uchar cmd)
{
while(lcd_busy());
LCD_RS = 0;
LCD_RW = 0;
LCD_EN = 0;
_nop_(); _nop_();
P0 = cmd;
delayNOP();
LCD_EN = 1;
delayNOP();
LCD_EN = 0;
}
/*************/
/* */
/*写显示数据到LCD */
/*RS=H,RW=L,E=高脉冲,D0-D7=数据。 */
/* */
/*************/
void lcd_wdat(uchar dat)
{
while(lcd_busy());
LCD_RS = 1;
LCD_RW = 0;
LCD_EN = 0;
P0 = dat;
delayNOP();
LCD_EN = 1;
delayNOP();
LCD_EN = 0;
}
/*************/
/* */
/* LCD初始化设定 */
/* */
/*************/
void lcd_init()
{
LCD_PSB = 1; //并口方式
lcd_wcmd(0x34); //扩充指令操作
delay(5);
lcd_wcmd(0x30); //基本指令操作
delay(5);
lcd_wcmd(0x0C); //显示开,关光标
delay(5);
lcd_wcmd(0x01); //清除LCD的显示内容
delay(5);
}
/*******
函数名称:Draw_PM
功 能:在整个液晶屏幕上画图
参 数:无
返回值 :无
********/
void Draw_PM(const uchar *ptr)
{
uchar i,j,k;
lcd_wcmd(0x34); //打开扩展指令集
i = 0x80;
for(j = 0;j < 32;j++)
{
lcd_wcmd(i++);
lcd_wcmd(0x80);
for(k = 0;k < 16;k++)
{ lcd_wdat(*ptr++);}
}
i = 0x80;
for(j = 0;j < 32;j++)
{ lcd_wcmd(i++);
lcd_wcmd(0x88);
for(k = 0;k < 16;k++)
{ lcd_wdat(*ptr++); }
}
lcd_wcmd(0x36); //打开绘图显示
lcd_wcmd(0x30); //回到基本指令集
}
main()
{ lcd_init(); //初始化LCD
Draw_PM(zhu); //显示设定的图片
while(1);
}
实物图
04
液晶显示模块接口方式的分类及优缺点:
并行接口
优点:
1.传递数据速度快;
2.可以从显示出来的图案或字符再读出来,这样就可以自由画点、及线
缺点:
1.接口线多(13个).为了省钱,客户会选择最少引脚的CPU,这样变成不得不考虑接口数量了。
2.如果客户主板与液晶屏的距离比较远,电线的成本也必须考虑。
串行接口
优点:
1.接口线少。
2.有些单片机有专门的SPI接口传输,正好配合。
缺点:
1.速度稍慢;
2.不可以读已显示到液晶屏上的图案、字符等数据。
I2C总线
优点:
1.接口线更少。
2.有些单片机有专门的I2C总线接口传输,正好配合。这种接口可以不用增加占用任何接口的情况下增加外部I2C设备:比如AT24C02 EEPROM
缺点:
1.因是飞利浦的专利,IC一般较贵。
2.应用不是很普遍,所以业务推广较难
05
供应商A:晶联讯
1、产品能力
(1)选型手册
(2)主推型号1:LX25696G-968-PL
对应的产品详情介绍
LX25696G-968-PL 型液晶显示模块既可以当成普通的图像型液晶显示模块使用(即显示普通图像型的
单色图片功能),又含有 JLX-GB2312-3207 字库 IC,可以从字库 IC 中读出内置的字库的点阵数据写入到
LCD 驱动 IC 中,以达到显示汉字的目的。
模块由 LCD 驱动 IC ST75256、字库 IC、背光组成
本文章源自奇迹物联开源的物联网应用知识库Cellular IoT Wiki,更多技术干货欢迎关注收藏Wiki:Cellular IoT Wiki 知识库(https://rckrv97mzx.feishu.cn/wiki/wikcnBvAC9WOkEYG5CLqGwm6PHf)
文章评论(0条评论)
登录后参与讨论