电子说
在电子设备的设计中,液晶显示模块是人机交互的重要组成部分。今天我们来深入了解一下Newhaven Display International公司的NHD - 0216K1Z - NSPG - FBW字符液晶显示模块,它具备诸多特性,能满足多种应用场景的需求。
NHD - 0216K1Z - NSPG - FBW是一款2行x16字符的液晶显示模块,其型号各部分含义如下:
| 该模块的引脚功能明确,如下表所示: | 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. 1.3V) | |
| 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 (5.0V via on - board resistor) | |
| 16 | LED - | Power Supply | Backlight Cathode (Ground) |
推荐使用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.5 | 5.0 | 5.5 | V |
| Supply Current | IDD | VDD = 5.0V | 0.5 | 1.0 | 2.0 | mA |
| Supply for LCD (contrast) | VLCD | TOP = 25°C | 3.5 | 3.7 | 3.9 | 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 | VLED | - | 4.9 | 5.0 | 5.1 | V |
| Backlight Supply Voltage | ILED | VLED = 5.0 V | 90 | 130 | 156 | mA |
| Item | Symbol | Condition | Min. | Typ. | Max. | Unit | ||
|---|---|---|---|---|---|---|---|---|
| Optimal Viewing Angles | Top | ϕY+ | CR ≥ 2 | - | 30 | - | ° | |
| Bottom | ϕY - | - | 60 | - | ° | |||
| Left | θX - | - | 45 | - | ° | |||
| Right | θX+ | - | 45 | - | ° | |||
| Contrast Ratio | CR | - | - | 5 | - | - | ||
| Response Time | Rise | TR | TOP = 25°C | - | 150 | 200 | ms | |
| Fall | TF | - | 150 | 200 | 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 | ||
| Entry mode Set | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | I/D | SH | Sets cursor move direction and specifies display shift. These parameters are performed during data write and read. | 37µs | ||
| Display ON/ OFF control | 0 | 0 | 0 | 0 | 0 | 0 | 1 | D | C | B | D = 1: Entire display on C = 1: Cursor on B = 1: Blinking cursor on | 37µs | ||
| Cursor or Display shift | 0 | 0 | 0 | 0 | 0 | 1 | S/C | R/L | - | - | Sets cursor moving and display shift control bit, and the direction without changing DDRAM data. | 37µs | ||
| Function set | 0 | 0 | 0 | 0 | 1 | DL | N | F | - | - | DL: Interface data is 8/4 bits N: Number of lines is 2/1 F: Font size is 5x11/5x8 | 37µs | ||
| Set CGRAM Address | 0 | 0 | 0 | 1 | AC5 AC4 AC3 AC2 AC1 AC0 | Set CGRAM address in address counter | 37µs | |||||||
| Set DDRAM Address | 0 | 0 | 1 | AC6 AC5 AC4 AC3 AC2 AC1 AC0 | Set DDRAM address in address counter. | 37µs | ||||||||
| Read busy Flag and Address | 0 | 1 | BF | AC6 AC5 AC4 AC3 AC2 AC1 AC0 | Whether during internal operation or not can be known by reading BF. The contents of address counter can also be read. | 0s | ||||||||
| Write data To Address | 1 | 0 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | Write data into internal RAM (DDRAM/CGRAM). | 37µs | ||
| Read data From RAM | 1 | 1 | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | Read data from internal RAM (DDRAM/CGRAM). | 37µs |
这些指令为工程师实现各种显示功能提供了便利,大家在使用时是否会根据具体需求灵活组合这些指令呢?
| 从MPU向ST7066U写数据时,有如下时序要求: | 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 |
| 从ST7066U向MPU读数据时,时序要求如下: | 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 |
严格遵守这些时序要求,才能确保数据的准确读写,大家在实际设计中是否会特别关注这些时序参数呢?
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;
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
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
P1 = i;
D_I = 1; //D/I = HIGH: send data
R_W = 0;
Nybble();
i = i < < 4;
P1 = i;
Nybble(); //R/W = LOW: Write //Clock upper 4 bits //Shift over by 4 bits //put data on output Port //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
}
不同的初始化方式适用于不同的应用场景,大家在实际开发中会如何选择呢?
| 该模块经过了多项质量测试,如下表所示: | Test Item | Content of Test | Test Condition | Note |
|---|---|---|---|---|
| High Temperature storage | Endurance test applying the high storage temperature for a long time. | +80⁰C , 200 Hrs. | 2 | |
| Low Temperature storage | Endurance test applying the low storage temperature for a long time. | -30⁰C , 200 Hrs. | 1,2 | |
| High Temperature |
全部0条评论
快来发表一下你的评论吧 !