电子说
在电子设备的设计中,液晶显示模块是人机交互的重要组成部分。今天我们来详细解析Newhaven Display International推出的NHD - 0240AZ - FL - GBW字符液晶显示模块。
NHD - 0240AZ - FL - GBW是一款2行x40字符的液晶显示模块。从型号上看:
内置ST7066U控制器,其详细规格可从http://www.newhavendisplay.com/app_notes/ST7066U.pdf下载。
| Pin No. | Symbol | External Connection | Function Description |
|---|---|---|---|
| 1 | VSS | Power Supply Ground | 电源地 |
| 2 | VDD | Power Supply | 逻辑供电电压(+5.0V) |
| 3 | V0 | Power Supply | 对比度供电电压(约0.5V) |
| 4 | RS | MPU | 寄存器选择信号,RS = 0为命令,RS = 1为数据 |
| 5 | R/W | MPU | 读写选择信号,R/W = 1为读,R/W = 0为写 |
| 6 | E | MPU | 操作使能信号,下降沿触发 |
| 7 - 10 | DB4 - DB7 | MPU | 高4位双向三态数据总线 |
| 11 - 14 | DB0 - DB3 | MPU | 低4位双向三态数据总线(4位操作时不使用) |
| 15 | LED + | Power Supply | 背光源阳极(通过板载电阻接+5.0V) |
| 16 | LED - | Power Supply | 背光源阴极(接地) |
推荐使用2.54mm间距的引脚作为LCD连接器。
| Item | Symbol | Condition | Min. | Typ. | Max. | Unit |
|---|---|---|---|---|---|---|
| 工作温度范围 | TOP | Absolute Max | -20 | - | +70 | ⁰C |
| 存储温度范围 | TST | Absolute Max | -30 | - | +80 | ⁰C |
| 电源电压 | VDD | - | 4.8 | 5.0 | 5.2 | V |
| 电源电流 | IDD | VDD = 5.0V | 1.0 | 2.5 | 3.0 | mA |
| LCD对比度电压 | VLCD | TOP = 25°C | 4.3 | 4.5 | 4.7 | 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 |
| 背光源电源电压 | VLED | - | 4.8 | 5.0 | 5.2 | V |
| 背光源电源电流 | ILED | VLED = 5.0V | 120 | 140 | 160 | mA |
| Item | Symbol | Condition | Min. | Typ. | Max. | Unit |
|---|---|---|---|---|---|---|
| 最佳视角(Top) | ϕY + | CR ≥ 2 | - | 40 | - | ⁰ |
| 最佳视角(Bottom) | ϕY - | - | 60 | - | ⁰ | |
| 最佳视角(Left) | θX - | - | 60 | - | ⁰ | |
| 最佳视角(Right) | θX + | - | 60 | - | ⁰ | |
| 对比度 | CR | - | 2 | 5 | - | - |
| 响应时间(Rise) | TR | TOP = 25°C | - | 150 | 250 | ms |
| 响应时间(Fall) | TF | - | 200 | 300 | ms |
| 内置的ST7066U控制器支持多种指令操作,以下是部分常用指令: | Instruction | Instruction code | Description | 270 KHZ Execution time (fosc = ) |
|---|---|---|---|---|
| Clear Display | 0 0 0 0 0 0 0 0 0 1 | 向DDRAM写入 “20H” 并将DDRAM地址从AC设置为 “00H” | 1.52ms | |
| Return Home | 0 0 0 0 0 0 0 0 1 - | 将DDRAM地址从AC设置为 “00H”,若光标移动则返回原位置,DDRAM内容不变 | 1.52ms | |
| Entry mode Set | 0 0 0 0 0 0 0 1 I/D SH | 设置光标移动方向和显示移位,在数据读写时执行 | 37µs | |
| Display ON/ OFF control | 0 0 0 0 0 0 1 D C B | D = 1:整个显示开启;C = 1:光标开启;B = 1:闪烁光标开启 | 37µs | |
| Cursor or Display shift | 0 0 0 0 0 1 S/C R/L - - | 设置光标移动和显示移位控制位及方向,不改变DDRAM数据 | 37µs | |
| Function set | 0 0 0 0 1 DL N F - - | DL:接口数据为8/4位;N:行数为2/1;F:字体大小为5x11/5x8 | 37µs |
| 参数 | 描述 | 引脚 | Min | Typ | Max | 单位 |
|---|---|---|---|---|---|---|
| Tc | 使能周期时间 | Pin E | 1200 | - | - | ns |
| TPW | 使能脉冲宽度 | Pin E | 140 | - | - | ns |
| TR,TF | 使能上升/下降时间 | Pin E | - | - | 25 | ns |
| TAS | 地址建立时间 | Pins: RS,RW,E | 0 | 0 | - | ns |
| TAH | 地址保持时间 | Pins: RS,RW,E | 10 | - | - | ns |
| TDSW | 数据建立时间 | Pins: DB0 - DB7 | 40 | - | - | ns |
| TH | 数据保持时间 | Pins: DB0 - DB7 | 10 | - | - | ns |
| 参数 | 描述 | 引脚 | Min | Typ | Max | 单位 |
|---|---|---|---|---|---|---|
| Tc | 使能周期时间 | Pin E | 1200 | - | 0 | ns |
| TPW | 使能脉冲宽度 | Pin E | 140 | - | - | ns |
| TR,TF | 使能上升/下降时间 | Pin E | - | - | 25 | ns |
| TAS | 地址建立时间 | Pins: RS,RW,E | 0 | 0 | - | ns |
| TAH | 地址保持时间 | Pins: RS,RW,E | 10 | - | - | ns |
| TDDR | 数据建立时间 | Pins: DB0 - DB7 | - | - | 100 | ns |
| TH | 数据保持时间 | Pins: DB0 - DB7 | 10 | - | - | ns |
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; //Clock enable: falling edge
}
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
}
void command(char i)
{
P1 = i; //put data on output Port
D_I = 0; //D/I=LOW : send instruction
R_W = 0;
Nybble();
i = i < < 4; //Shift over by 4 bits
P1 = i;
Nybble(); //Send upper 4 bits
}
void write(char i)
{
P1 = i; //put data on output Port
R_W = 0;
D_I = 1; //D/I=HIGH : send data
Nybble();
i = i < < 4; //Shift over by 4 bits
P1 = i;
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);
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); //Function set: 4-bit/2-line
command (0x10); //Set cursor
command (0x0F); //Display ON; Blinking cursor
command (0x06); //Entry Mode set
}
| Test Item | Content of Test | Test Condition | Note |
|---|---|---|---|
| High Temperature storage | 长时间施加高存储温度的耐久性测试 | +80⁰C , 48hrs | 2 |
| Low Temperature storage | 长时间施加低存储温度的耐久性测试 | -30⁰C , 48hrs | 1,2 |
| High Temperature Operation | 长时间施加电应力(电压和电流)和高热应力的耐久性测试 | +70⁰C 48hrs | 2 |
| Low Temperature Operation | 长时间施加电应力(电压和电流)和低热应力的耐久性测试 | -20⁰C , 48hrs | 1,2 |
| High Temperature / Humidity Operation | 长时间施加电应力(电压和电流)以及高温高湿应力的耐久性测试 | +40⁰C , 90% RH , 48hrs | 1,2 |
| Thermal Shock resistance | 在高低热应力循环期间施加电应力(电压和电流)的耐久性测试 | 0⁰C,30min -> 25⁰C,5min -> 50⁰C,30min = 1 cycle 10 cycles | |
| Vibration test | 施加振动以模拟运输和使用的耐久性测试 | 10 - 55Hz , 15mm振幅。每个方向(X,Y,Z)60秒,共15分钟 | 3 |
| Static electricity test | 施加静电放电的耐久性测试 | VS = 800V, RS = 1.5kΩ, CS = 100pF One time |
在使用NHD - 0240AZ - FL - GBW字符液晶显示模块时,工程师们需要综合考虑其各项特性和参数,合理设计电路和编写程序,以确保模块的正常运行。你在实际使用该模块时遇到过哪些问题呢?欢迎在评论区分享。
全部0条评论
快来发表一下你的评论吧 !