电子说
在电子设计领域,液晶显示模块是人机交互的重要组成部分。今天我们来深入剖析Newhaven Display International公司的NHD - 0220WH - LYYH - JT#字符液晶显示模块。
| Pin No. | Symbol | External Connection | Function Description |
|---|---|---|---|
| 1 | VSS | 电源 | 接地 |
| 2 | VDD | 电源 | 逻辑供电电压(+5.0V) |
| 3 | V0 | 电源 | 对比度供电电压(约0.5V) |
| 4 | RS | MPU | 寄存器选择信号。RS = 0:命令;RS = 1:数据 |
| 5 | R/W | MPU | 读写选择信号,R/W = 1:读;R/W = 0:写 |
| 6 | E | MPU | 操作使能信号,下降沿触发 |
| 7 - 10 | DB0 - DB3 | MPU | 四位低阶双向三态数据总线,4位操作时不使用 |
| 11 - 14 | DB4 - DB7 | MPU | 四位高阶双向三态数据总线 |
| 15 | LED+ | 电源 | 背光源阳极(4.3V时360mA) |
| 16 | LED - | 电源 | 背光源阴极(接地) |
推荐使用2.54mm间距引脚的LCD连接器,但文档未提及背光源连接器的匹配信息。
| 项目 | 符号 | 条件 | 最小值 | 典型值 | 最大值 | 单位 |
|---|---|---|---|---|---|---|
| 工作温度范围 | TOP | 绝对最大 | -20 | - | +70 | °C |
| 存储温度范围 | TST | 绝对最大 | -30 | - | +80 | °C |
| 电源电压 | VDD | - | 4.5 | 5.0 | 5.5 | V |
| 电源电流 | IDD | VDD = 5.0V,TOP = 25°C | 0.3 | 1.5 | 3.3 | mA |
| LCD供电(对比度) | VLCD | - | 4.1 | 4.3 | 4.5 | V |
| “H” 电平输入 | VIH | - | 0.7 * VDD | - | VDD | V |
| “L” 电平输入 | VIL | - | VSS | - | 0.6 | V |
| “H” 电平输出 | VOH | - | 3.9 | - | VDD | V |
| “L” 电平输出 | VOL | - | VSS | - | 0.4 | V |
| 背光源供电电流 | ILED | - | 288 | 360 | 432 | mA |
| 背光源供电电压 | VLED | ILED = 360mA | 4.1 | 4.3 | 4.5 | V |
| 背光源寿命 | - | - | - | - | 100,000 | Hrs |
| 项目 | 符号 | 条件 | 最小值 | 典型值 | 最大值 | 单位 |
|---|---|---|---|---|---|---|
| 最佳视角 - 顶部 | ϕY+ | CR ≥ 2 | - | 20 | - | ° |
| 最佳视角 - 底部 | ϕY - | - | - | 40 | - | ° |
| 最佳视角 - 左侧 | θX - | - | - | 30 | - | ° |
| 最佳视角 - 右侧 | θX+ | - | - | 30 | - | ° |
| 对比度 | CR | - | 2 | 3 | - | - |
| 响应时间 - 上升 | TR | TOP = 25°C | - | 150 | 200 | ms |
| 响应时间 - 下降 | TF | - | - | 150 | 200 | ms |
模块内置ST7066U控制器,其规格文档可从http://www.newhavendisplay.com/app_notes/ST7066U.pdf下载。
| 该模块提供了丰富的指令,用于控制显示、设置参数等,以下是部分指令示例: | 指令 | 指令代码(RS、R/W、DB7 - DB0) | 描述 | 执行时间(fOSC = 270 KHZ) |
|---|---|---|---|---|
| 清屏 | 0 0 0 0 0 0 0 0 0 1 | 将“20H”写入DDRAM并将DDRAM地址从AC设置为“00H” | 1.52ms | |
| 归位 | 0 0 0 0 0 0 0 0 1 - | 将DDRAM地址从AC设置为“00H”,若光标移动则返回原位置,DDRAM内容不变 | 1.52ms | |
| 输入模式设置 | 0 0 0 0 0 0 0 1 I/D SH | 设置光标移动方向和显示移位,在数据读写时执行 | 37µs | |
| 显示开/关控制 | 0 0 0 0 0 0 1 D C B | D = 1:整个显示开启;C = 1:光标开启;B = 1:闪烁光标开启 | 37µs |
| 符号 | 描述 | 引脚 | 时间 | 单位 | |
|---|---|---|---|---|---|
| Tc | 使能周期时间 | 引脚E | 1200 | ns | |
| TPW | 使能脉冲宽度 | 引脚E | 140 | ns | |
| TR,TF | 使能上升/下降时间 | 引脚E | - | 25 | ns |
| TAS | 地址建立时间 | 引脚RS、RW、E | 0 | - | ns |
| TAH | 地址保持时间 | 引脚RS、RW、E | 10 | - | ns |
| TDSW | 数据建立时间 | 引脚DB0 - DB7 | 40 | - | ns |
| TH | 数据保持时间 | 引脚DB0 - DB7 | 10 | - | ns |
其时间参数与写数据类似,如使能周期时间Tc为1200ns,使能脉冲宽度Tpw为140ns等。
void command(char i)
{
P1 = i; //put data on output Port
D_I = 0; //D/I=LOW : send instruction
R_W = 0; //R/W=LOW:Write
E = 1;
Delay(1);
Delay(1); //enable pulse width >= 300ns
E = 0; //Clock enable: falling edge
}
void write(char i)
{
E = 0;
P1 = i;
D_I = 1; //D/I=HIGH : send data
R_W = 0; //R/W=LOW:Write
E = 1;
Delay(1); //enable pulse width >= 300ns
Delay(1);
E = 0; //Clock enable:falling edge
}
void init()
{
E = 0;
Delay(100);
Delay(100); //Wait >40 msec after power is applied
command(0x30); //command 0x30 = Wake up
command(0x30);
Delay(30);
Delay(30); //must wait 5ms, busy flag not available
command(0x30); //command 0x30 = Wake up #2
Delay(10);
Delay(10); //must wait 160us, busy flag not available
command(0x30); //command 0x30 = Wake up #3
Delay(10);
Delay(10); //must wait 160us, busy flag not available
command(0x38);
command(0x38); //Function set: 8-bit/2-line
command(0x10);
command(0x0c);
command(0x06); //Set cursor //Display ON; Cursor ON //Entry mode set
}
void command(char i)
{
P1 = i; //put data on output Port
D_I = 0; //D/I=LOW : send instruction
R_W = 0;
Nybble();
P1 = i;
i = i < < 4; //R/W=LOW:Write //Send Upper 4 bits //Shift over by 4 bits
P1 = i; //put data on output Port
Nybble(); //Send upper 4 bits
}
void write(char i)
{
P1 = i; //put data on output Port
D_I = 1; //D/I=HIGH: send data
R_W = 0;
Nybble();
i = i < < 4;
P1 = i; //R/W=LOW: Write //Clock Upper 4 bits //Shift over by 4 bits
P1 = i; //put data on output Port
Nybble(); //Clock upper 4 bits
}
void Nybble()
{
E = 1;
Delay(1);
Delay(1); //enable pulse width >= 300ns
E = 0; //Clock enable:falling edge
}
void init()
{
P1 = 0;
P3 = 0;
Delay(100);
Delay(100); //Wait >40 msec after power is applied
P1 = 0x30;
P1 = 0x30; //put 0x30 on the output port
Delay(30); //must wait 5ms, busy flag not available
Delay(30);
Nybble(); //command 0x30 = Wake up
Delay(10);
Delay(10); //must wait 160us, busy flag not available
Nybble(); //command 0x30= Wake up #2
Delay(10);
Delay(10); //must wait 160us, busy flag not available
Nybble(); //command 0x30 = Wake up #3
Delay(10);
Delay(10); //can check busy flag now instead of delay
P1 = 0x20; //put 0x20 on the output port
P1 = 0x20;
Nybble();
Nybble(); //Function set: 4-bit interface
command(0x28);
command(0x28); //Function set: 4-bit/2-line
command(0x10);
command(0x0F); //Set cursor
command(0x0F); //Display ON; Blinking cursor
command(0x06); //Entry Mode set
}
该模块经过了多项质量测试,如高温存储、低温存储、高温运行、低温运行、高温高湿运行、热冲击抗性、振动测试和静电测试等,测试条件和时间都有明确规定。
使用LCD/LCM时的注意事项可在www.newhavendisplay.com/specs/precautions.pdf查看,保修信息和条款可访问http://www.newhavendisplay.com/index.php?main_page=terms。
在实际设计中,电子工程师需要根据这些特性和参数合理使用该模块,确保系统的稳定性和可靠性。大家在使用这个模块时有遇到过什么问题吗?欢迎在评论区交流。
全部0条评论
快来发表一下你的评论吧 !