电子说
在电子设备的开发中,液晶显示模块是一个关键的组件,它能为用户提供直观的信息展示。今天,我们就来详细剖析Newhaven Display International公司的NHD - 0420DZ - FL - YBW - 3V3字符液晶显示模块。
NHD - 0420DZ - FL - YBW - 3V3这个型号包含了丰富的信息:
该模块具有以下特点:
| Pin NO | Symbol |
|---|---|
| 1 | VSS |
| 2 | VDD |
| 3 | V0 |
| 4 | RS |
| 5 | R/W |
| 6 | E |
| 7 | DB0 |
| 8 | DB1 |
| 9 | DB2 |
| 10 | DB3 |
| 11 | DB4 |
| 12 | DB5 |
| 13 | DB6 |
| 14 | DB7 |
| 15 | LED+ |
| 16 | LED - |
各引脚的功能如下:
| Item | Symbol | Condition | Min. | Typ. | Max. | Unit |
|---|---|---|---|---|---|---|
| 工作温度范围 | Top | 绝对最大 | - 20 | - | +70 | ⁰C |
| 存储温度范围 | Tst | 绝对最大 | - 30 | - | +80 | ⁰C |
| 电源电压 | VDD | 3.0 | 3.3 | 3.5 | V | |
| 电源电流 | IDD | Ta = 25°C, VDD = 3.3V | - | 2 | 3.0 | mA |
| LCD对比度电源 | VDD - V0 | Ta = 25°C | 2.8 | 3.0 | 3.3 | V |
| “H” 电平输入 | Vih | 0.7 VDD | - | VDD | V | |
| “L” 电平输入 | Vil | 0 | - | 0.6 | V | |
| “H” 电平输出 | Voh | 0.75 VDD | - | - | V | |
| “L” 电平输出 | Vol | - | - | 0.2 VDD | V | |
| 背光电源电压 | Vled | - | - | 3.0 | 3.3 | V |
| 背光电源电流 | Iled | Vled = 3.0V | - | 240 | - | mA |
| Item | Symbol | Condition | Min. | Typ. | Max. | Unit |
|---|---|---|---|---|---|---|
| 垂直视角(上) | AV | Cr ≥2 | - | 25 | - | ⁰ |
| 垂直视角(下) | AV | Cr ≥2 | - | 70 | - | ⁰ |
| 水平视角(左) | AH | Cr ≥2 | - | 30 | - | ⁰ |
| 水平视角(右) | AH | Cr ≥2 | - | 30 | - | ⁰ |
| 对比度 | Cr | - | 2 | - | - | |
| 响应时间(上升) | Tr | - | - | 120 | 150 | ms |
| 响应时间(下降) | Tf | - | - | 120 | 150 | ms |
这些参数为工程师在设计电路和评估显示效果时提供了重要的参考依据。例如,工作温度范围决定了该模块可以在哪些环境下稳定工作,而对比度和视角则影响了用户的视觉体验。
该模块内置ST7066U控制器,其详细规格可从http://www.newhavendisplay.com/app_notes/ST7066U.pdf下载。这意味着工程师可以根据该文档深入了解控制器的工作原理和编程方法,从而更好地实现显示功能。
| Instruction | Instruction Code | Description | Description Time (270KHz) | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| RS | R/W | DB7 | DB6 | DB5 | DB4 | DB3 | DB2 | DB1 | DB0 | |||
| 清屏 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 将 “20H” 写入DDRAM,并将DDRAM地址从AC设置为 “00H” | 1.52 ms |
| 返回主页 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | X | 将DDRAM地址从AC设置为 “00H”,并将光标移回原始位置(如果已移动),DDRAM内容不变 | 1.52 ms |
| 输入模式设置 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | VD | S | 设置光标移动方向并指定显示移位,在数据读写时执行这些操作 | 37 us |
| 显示开/关 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | D | C | B | D = 1:整个显示打开;C = 1:光标打开;B = 1:光标位置显示 | 37 us |
| 光标或显示移位 | 0 | 0 | 0 | 0 | 0 | 1 | S/C | R/L | X | X | 设置光标移动和显示移位控制位及方向,不改变DDRAM数据 | 37 us |
| 功能设置 | 0 | 0 | 0 | 0 | 1 | DL | N | F | X | X | DL:接口数据为8/4位;N:行数为2/1;F:字体大小为5x11/5x8 | 37 us |
| 设置CGRAM地址 | 0 | 0 | 0 | 1 | AC5 | AC4 | AC3 | AC2 | AC1 | AC0 | 在地址计数器中设置CGRAM地址 | 37 us |
| 设置DDRAM地址 | 0 | 0 | 1 | AC6 | AC5 | AC4 | AC3 | AC2 | AC1 | AC0 | 在地址计数器中设置DDRAM地址 | 37 us |
| 读取忙标志和地址 | 0 | 1 | BF | AC6 | AC5 | AC4 | AC3 | AC2 | AC1 | AC0 | 通过读取BF可知是否处于内部操作中,也可读取地址计数器内容 | 0 us |
| 写入数据到RAM | 1 | 0 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | 将数据写入内部RAM(DDRAM/CGRAM) | 37 us |
| 从RAM读取数据 | 1 | 1 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | 从内部RAM(DDRAM/CGRAM)读取数据 | 37 us |
这些指令为工程师提供了控制显示模块的具体方法,通过发送不同的指令,可以实现清屏、设置显示模式、读写数据等功能。
/**********************************************************/
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); //enable pulse width >= 300ns
E = 0; //Clock enable: falling edge
}
/**********************************************************/
void write(char i)
{
P1 = i; //put data on output Port
D_I = 1; //D/I=HIGH : send data
R_W = 0; //R/W=LOW: Write
E = 1;
Delay(1); //enable pulse width >= 300ns
E = 0; //Clock enable: falling edge
}
void init()
{
E = 0;
Delay(100); //Wait >15 msec after power is applied
command(0x30); //command 0x30 = Wake up
Delay(30); //must wait 5ms, busy flag not available
command(0x30); //command 0x30 = Wake up #2
Delay(10); //must wait 160us, busy flag not available
command(0x30); //command 0x30 = Wake up #3
Delay(10); //must wait 160us, busy flag not available
command(0x38); //Function set: 8-bit/2-line
command(0x0c); //Display ON; Cursor ON
command(0x06); //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(); //Send lower 4 bits
i = i < < 4; //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; //R/W=LOW : Write
Nybble(); //Clock lower 4 bits
i = i < < 4; //Shift over by 4 bits
P1 = i; //put data on output Port
Nybble(); //Clock upper 4 bits
}
void Nybble()
{
E = 1;
Delay(1); //enable pulse width >= 300ns
E = 0; //Clock enable: falling edge
}
void init()
{
P1 = 0; P3 = 0;
Delay(100); //Wait >15 msec after power is applied
P1 = 0x30; //put 0x30 on the output port
Delay(30); //must wait 5ms, busy flag not available
Nybble(); //command 0x30 = Wake up
Delay(10); //must wait 160us, busy flag not available
Nybble(); //command 0x30 = Wake up #2
Delay(10); //must wait 160us, busy flag not available
Nybble(); //command 0x30 = Wake up #3
Delay(10); //can check busy flag now instead of delay
P1 = 0x20; //put 0x20 on the output port
Nybble(); //Function set: 4-bit interface
command(0x28); //Function set: 4-bit/2-line
command(0x10); //Set cursor
command(0x0F); //Display ON; Blinking cursor
command(0x06); //Entry Mode set
}
****
不同的初始化方式适用于不同的应用场景,工程师可以根据实际需求选择合适的初始化方法。
该模块经过了多项质量测试,包括高温存储、低温存储、高温操作、低温操作、高温高湿操作、热冲击抵抗、振动测试和静电测试等。这些测试确保了产品在不同环境下的可靠性和稳定性。
在使用该液晶显示模块时,需要注意一些事项,具体内容可在www.newhavendisplay.com/specs/precautions.pdf查看。同时,关于保修信息和条款可访问http://www.newhavendisplay.com/index.php?main_page=terms。
总之,NHD - 0420DZ - FL - YBW - 3V3字符液晶显示模块具有丰富的功能和良好的性能,适用于多种电子设备的信息显示。电子工程师在设计时,可根据其特性和参数进行合理的电路设计和编程,以实现理想的显示效果。大家在实际使用过程中遇到过哪些问题呢?欢迎交流分享。
全部0条评论
快来发表一下你的评论吧 !