电子说
在电子设备的开发过程中,液晶显示模块是不可或缺的一部分。今天,我们就来详细探讨一下Newhaven Display International公司的NHD - 0220AZ - FL - YBW字符液晶显示模块。
NHD - 0220AZ - FL - YBW是一款具备2行20字符显示能力的液晶显示模块。其型号各部分含义如下:
该模块具有2行20字符的显示能力,内置ST7066U控制器,采用 +5.0V电源供电,支持1/16 duty和1/5 bias,同时符合RoHS标准。
| 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 | Supply Voltage for contrast (approx. 0.4V) |
| 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 | Backlight Anode (145 mA @ 5V) |
| 16 | LED - | Power Supply | Backlight Cathode (Ground) |
推荐的LCD连接器为2.54mm间距引脚,不过文档未提及背光连接器相关匹配信息。
| 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.0 | 2.0 | 2.5 | mA |
| Supply for LCD (contrast) | VLCD | TOP = 25°C | 4.3 | 4.5 | 4.7 | 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 | - | VSS | - | 0.4 | V |
| Backlight Supply Current | ILED | - | 120 | 145 | 170 | mA |
| Backlight Supply Voltage | VLED | ILED = 145 mA | 4.8 | 5.0 | 5.3 | V |
需要注意的是,背光的LED由电流驱动,驱动电压仅作参考,必须选择合适的驱动电压以确保背光电流低于最大规定值。
| 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 | TOP = 25°C | - | 150 | 250 | ms | |
| Fall | TF | - | 200 | 300 | ms |
| 模块内置ST7066U控制器,其详细规格可从http://www.newhavendisplay.com/app_notes/ST7066U.pdf下载。DDRAM地址分布如下: | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 14 |
|---|---|---|---|---|---|---|---|---|---|---|
| 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 | ||||||||||
| 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 |
| 文档中给出了一系列指令,包括清屏、归位、设置显示模式等,每个指令都有对应的指令码、描述和执行时间。例如: | Instruction code | Instruction | Description | Execution time (fOSC = 270 KHZ) |
|---|---|---|---|---|
| 0 0 0 0 0 0 0 0 0 1 | Clear Display | Write “20H” to DDRAM and set DDRAM address to “00H” from AC | 1.52ms | |
| 0 0 0 0 0 0 0 0 1 | Home Return | 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 |
| Tc | Enable Cycle Time | Pin E | 1200 | ns | ||
|---|---|---|---|---|---|---|
| TPW | Enable Pulse Width | Pin E | 140 | ns | ||
| TR,TF | Enable Rise/Fall Time | Pin E | 25 | ns | ||
| TAS | Address Setup Time | Pins: RS,RW,E | 0 | 0 | ns | |
| TAH | Address Hold Time | Pins: RS,RW,E | 10 | - | ns | |
| TDSW | Data Setup Time | Pins: DB0 - DB7 | 40 | - | ns | |
| TH | Data Hold Time | Pins: DB0 - DB7 | 10 | ns |
| Tc | Enable Cycle Time | Pin E | 1200 | 0 | ns | |
|---|---|---|---|---|---|---|
| TPW | Enable Pulse Width | Pin E | 140 | ns | ||
| TR,TF | Enable Rise/Fall Time | Pin E | 25 | ns | ||
| TAS | Address Setup Time | Pins: RS,RW,E | 0 | 0 | ns | |
| TAH | Address Hold Time | Pins: RS,RW,E | 10 | ns | ||
| TDDR | Data Setup Time | Pins: DB0 - DB7 | - | 100 | ns | |
| TH | Data Hold Time | Pins: DB0 - DB7 | 10 | ns |
文档中给出了内置字体表,但具体内容由于格式问题未详细展开,在实际使用中可根据表中的编码来显示相应字符。
代码实现了8位初始化的过程,包括唤醒模块、设置功能、显示模式等。例如:
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
R_W = 0;
D_I = 1; //D/I = HIGH : send data
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 = Wake up
Delay(30);
command (0x30); //command 0x30 = Wake up #2
Delay (10);
command (0x30); //command 0x30 = Wake up #3
Delay (10);
command (0x38); //Function set: 8 - bit/2 - line
command (0x10);
command (0x0c);
command (0x06); //Set cursor //Display ON; Cursor ON //Entry mode set
}
同样实现了4位初始化的功能,将数据分高4位和低4位进行传输。
void command(char i)
{
P1 = i; //put data on output Port
D_I = 0;
R_W = 0;
Nybble();
i = i < < 4;
P1 = i;
Nybble(); //Send upper 4 bits
}
void write(char i)
{
P1 = i;
D_I = 1;
R_W = 0;
Nybble();
i = i < < 4;
P1 = i;
Nybble ();
}
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);
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
Nybble ();
command (0x28); //Function set: 4 - bit/2 - line
command (0x10); //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条评论
快来发表一下你的评论吧 !