电子说
在电子设计领域,液晶显示模块是人机交互中不可或缺的重要组件。今天,我们就来详细探讨Newhaven Display International推出的NHD - 0216PZ - FL - YBW - PC字符液晶显示模块。
NHD - 0216PZ - FL - YBW - PC是一款具备2行16字符显示能力的液晶显示模块。通过型号解读,我们能了解到它的诸多特性:
模块的机械绘图是Newhaven Display International的专有财产,未经许可不得复制、再现或披露。这保障了产品设计的知识产权和独特性。
| Pin No. | Symbol | External Connection | Function Description |
|---|---|---|---|
| 1 | VSS | Power Supply | Ground |
| 2 | VDD | Power Supply | Supply Voltage for logic (+5.0V) |
| 3 | V0 | Adj Power Supply | Power supply for contrast (approx. 0.6V) |
| 4 | RS | MPU | Register select signal. RS = 0: Command, RS = 1: Data |
| 5 | R/W | MPU | Read/Write select signal, R/W = 1: Read R/W: = 0: Write |
| 6 | E | MPU | Operation enable signal. Falling edge triggered. |
| 7 - 10 | DB0 – DB3 | MPU | Four low order bi - directional three - state data bus lines. These four are not used during 4 - bit operation. |
| 11 - 14 | DB4 – DB7 | MPU | Four high order bi - directional three - state data bus lines. |
| 15 | LED - | Power Supply | Ground for Backlight |
| 16 | LED + | Power Supply | Power supply for LED Backlight (+5.0V via on - board resistor) |
推荐使用2.54mm间距的引脚作为LCD连接器。
| Item | Symbol | Condition | Min. | Typ. | Max. | Unit |
|---|---|---|---|---|---|---|
| Operating Temperature Range | Top | Absolute Max | - 20 | - | +70 | ⁰C |
| Storage Temperature Range | Tst | Absolute Max | - 30 | - | +80 | ⁰C |
| Supply Voltage | VDD | - | 4.7 | 5.0 | 5.3 | V |
| Supply Current | IDD | VDD = 5.0V | - | 1.5 | 2.0 | mA |
| Supply for LCD (contrast) | VDD - V0 | Ta = 25°C | 4.2 | 4.4 | 4.6 | V |
| “H” Level input | Vih | - | 0.7*VDD | - | VDD | V |
| “L” Level input | Vil | - | VSS | - | 0.6 | V |
| “H” Level output | Voh | - | 3.9 | - | VDD | V |
| “L” Level output | Vol | - | - | - | 0.4 | V |
| Backlight Supply Voltage | Vled | - | 4.7 | 5.0 | 5.3 | V |
| Backlight Supply Current | Iled | Vled = 5.0V | 40 | 50 | 60 | mA |
从这些电气参数中,我们可以看到该模块在不同温度环境下的工作和存储范围,以及供电和电流需求等关键信息。在实际设计中,我们需要确保电源和电路能够满足这些参数要求,以保证模块的正常工作。
| Item | Symbol | Condition | Min. | Typ. | Max. | Unit | ||
|---|---|---|---|---|---|---|---|---|
| Optimal Viewing Angles | Top | ϕY+ | Cr ≥ 2 | - | 40 | - | ⁰ | |
| Bottom | ϕY - | - | 60 | - | ⁰ | |||
| Left | θX - | - | 60 | - | ⁰ | |||
| Right | θX+ | - | 60 | - | ⁰ | |||
| Contrast Ratio | Cr | 2 | 5 | - | - | |||
| Response Time | Rise | Tr | - | - | 150 | 250 | ms | |
| Fall | Tf | - | - | 200 | 300 | ms |
这些光学特性决定了模块的视觉效果,例如最佳视角和对比度等。在实际应用中,我们需要根据具体的使用场景来考虑这些因素,以确保用户能够获得良好的视觉体验。
模块内置了ST7066U控制器,其详细规格可从http://www.newhavendisplay.com/app_notes/ST7066U.pdf下载。了解控制器的特性和功能对于正确驱动和使用模块至关重要。
| 模块提供了丰富的指令集,用于控制显示内容、光标位置、显示开关等功能。例如: | Instruction | Instruction code | Description | 270 KHZ Execution time (fosc = | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| RS | R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 | ||||||||||||
| Clear Display | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | Write “20H” to DDRAM and set DDRAM address to “00H” from AC | 1.52ms | |
| Return Home | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | - | Set DDRAM Address to “00H” from AC and return cursor to its original position if shifted. The contents of DDRAM are not changed. | 1.52ms |
在实际编程中,我们需要根据需求选择合适的指令来实现相应的功能。
无论是从MPU向ST7066U写入数据,还是从ST7066U向MPU读取数据,都有严格的时序要求。例如,写入数据时,Enable Cycle Time(Tc)要求为1200ns,Enable Pulse Width(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) {
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);
Delay(1); //enable pulse width >= 300ns
E = 0;
}
void init() {
E = 0;
Delay(100); //Wait >40 msec after power is applied
command(0x30);
command(0x30); //command 0x30 = Wake up
Delay(30);
command(0x30);
command(0x30); //command 0x30 = Wake up #2
Delay(10);
command(0x30);
command(0x30); //command 0x30 = Wake up #3
Delay(10);
command(0x38);
command(0x38); //Function set: 8 - bit/2 - line
command(0x10); //Set cursor
command(0x0c);
command(0x0c); //Display ON; Cursor ON
command(0x06); //Entry mode set
}
void command(char i) {
P1 = i;
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;
Nybble(); //Send upper 4 bits
}
void write(char i) {
P1 = i;
D_I = 1; //D/I = HIGH : send data
R_W = 0;
Nybble(); //Clock lower 4 bits
i = i < < 4;
P1 = i;
Nybble(); //Clock upper 4 bits
}
void Nybble() {
E = 1;
Delay(1); //enable pulse width >= 300ns
E = 0;
}
void init() {
P1 = 0; P3 = 0;
Delay(100); //Wait >40 msec after power is applied
P1 = 0x30;
Delay(30);
Nybble(); //command 0x30 = Wake up
Delay(10);
Nybble(); //command 0x30 = Wake up #2
Delay(10);
Nybble(); //command 0x30 = Wake up #3
Delay(10);
P1 = 0x20;
Nybble(); //Function set: 4 - bit interface
command(0x28);
command(0x28); //Function set: 4 - bit/2 - line
command(0x10); //Set cursor
command(0x0F);
command(0x0F); //Display ON; Blinking cursor
command(0x06); //Entry Mode set
}
不同的初始化方式适用于不同的应用场景,我们可以根据实际需求进行选择。
模块经过了一系列严格的质量测试,包括高温存储、低温存储、高温运行、低温运行、高温高湿运行、热冲击抵抗、振动测试和静电测试等。这些测试确保了模块在不同环境下的可靠性和稳定性。
在使用LCDs/LCMs时,需要注意一些事项,具体可参考www.newhavendisplay.com/specs/precautions.pdf。同时,关于保修信息和条款可查看http://www.newhavendisplay.com/index.php?main_page=terms。
总之,NHD - 0216PZ - FL - YBW - PC字符液晶显示模块在电子设计中具有广泛的应用前景。通过深入了解其特性、参数和使用方法,我们能够更好地将其应用到实际项目中。大家在使用过程中遇到过哪些问题呢?欢迎在评论区分享交流。
全部0条评论
快来发表一下你的评论吧 !