1602lcdMain technical parameters:
Display capacity: 16 × 2Characters
Chip Operating voltage: 4.5-5.5 V
Working current: 0mA (5.0 V)
Optimal module operating voltage: 5.0 V
Character size: 2.95x4.35 (w x H) mm
Pin Function Description
1602lcdAdopt Standard 14Foot (no backlight) or 16Pin (with backlight) interface. descriptions of each pin interface are shown in Table 10-13.As shown in:
NO. |
symbol |
pin description |
NO. |
symbol |
pin description |
1 |
VSS |
power supply location |
9 |
D2 |
data |
2 |
VDD |
Power Supply Cathode |
10 |
D3 |
data |
3 |
VL |
liquid crystal display bias |
11 |
D4 |
data |
4 |
RS |
data/ command selection |
12 |
D5 |
data |
5 |
r/W |
Read/ write selection |
13 |
D6 |
data |
6 |
E |
enable signal |
14 |
D7 |
data |
7 |
D0 |
data |
15 |
bla |
positive electrode of backlight |
8 |
D1 |
Data |
16 |
BLK |
Negative Backlight |
Table 10-13: PIN Interface Description
1stFoot: VSSIs the local power supply.
2ndFoot: VDDConnect to 5 VPositive power supply.
3rdFoot: VLFor the LCD contrast adjustment end, the contrast is the weakest when connected to the power source, the highest contrast when grounded, when the contrast is too high, will produce"Ghost shadows", You can use a 10 kAdjust the contrast.
4thFoot: RsSelect register, data register, and command register for Low-Power periods.
5thFoot: R/WIt is a read/write signal line, which is usually used for read operations during high-power periods and writes during low-power periods. When rsAnd R/WCommands or display addresses can be written for Low-Power scenarios.Low-Level R/WIn high-power scenarios, you can read busy signals when rsHigh R/WData can be written at low power consumption.
6thFoot: EEnd is the enable end, when eThe LCD module executes commands when the device is switched from a high-level hop to a low-power cycle.
7th~ 14Foot: D0~ D78Bit bidirectional data line.
15thFoot: positive pole of the backlight.
16thFoot: negative pole of the backlight.
1602lcdInstructions in a timely manner
1602A total of 11 controllers in the LCD ModuleControl commands, such as table 10-14As shown in:
Serial number |
Command |
RS |
R/W |
D7 |
D6 |
D5 |
D4 |
D3 |
D2 |
D1 |
D0 |
1 |
clear |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
2 |
cursor return |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
* |
3 |
set input mode |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
I/D |
S |
4 |
show on/ close control |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
d |
C |
B |
5 |
cursor or character Shift |
0 |
0 |
0 |
0 |
0 |
1 |
S/C |
R/L |
* |
* |
6 |
placement |
0 |
0 |
0 |
0 |
1 |
DL |
n |
F |
* |
* |
7 |
Memory Address with fixed characters |
0 |
0 |
0 |
1 |
Character memory address |
8 |
Data storage address |
0 |
0 |
1 |
Display data storage address |
9 |
Read busy sign or address |
0 |
1 |
BF |
Counter address |
10 |
Write count to cgramOr ddram) |
1 |
0 |
Data content to be written |
11 |
From cgramOr ddramReading |
1 |
1 |
Read data content |
Table 10-14: Control Command table
1602The read/write operations, screen operations, and optical mark operations of the LCD module are implemented through instruction programming. (Description: 1Is high, 0Is low)
Instruction 1: Clear display, script code 01 H,Reset cursor to address 00 hLocation.
Command 2: Reset the cursor. The cursor returns to the address 00 H..
Command 3: Set I/D for the cursor and Display Mode: The cursor moves in the direction, the high moves right, the low moves left S:Whether to move all text left or right on the screen. The high level indicates valid, and the low level indicates invalid.
Command 4: Display switch control. D: Controls the on and off of the overall display. The high level indicates the on display, and the low level indicates the off display C.: Controls the opening and closing of the cursor. The high level indicates a cursor, and the low level indicates no cursor B.: Control whether the cursor is blinking, high flashing, low non-flashing.
Command 5: Cursor or show shift S/C: Move the text displayed during high-voltage periods and move the cursor during low-voltage periods.
Command 6: Function setting command DL: The average power consumption is 4.Bit bus, usually 8Bit bus n: When the power supply is low, it is displayed as a single line. When the power supply is high, the dual line shows F:Low Power, usually 5x7Dot Matrix character, usually 5x10.
Command 7: Character generator RamAddress Settings.
Instruction 8: DdramAddress Settings.
Command 9: Read busy signal and cursor address BF: Indicates the busy flag. A high value indicates busy. At this time, the module cannot receive commands or data. A low value indicates not busy.
Command 10: Write data.
Instruction 11: Read data.
And HD44780The compatible chip timing table is as follows:
Read status |
Input |
Rs = L, R/W = H, E = H |
Output |
D0-D7 =Status word |
Write command |
Input |
Rs = L, R/W = L, D0-D7 =Script code, E =High pulse |
Output |
None |
Read data |
Input |
Rs = H, R/W = H, E = H |
Output |
D0-D7 =Data |
Write Data |
Input |
Rs = H, R/W = L, D0-D7 =Data, E =High pulse |
Output |
None |
1602lcdGeneral initialization (reset) Process
Latency: 15 ms
Write command 38 H(Do not detect busy signals)
Latency: 5 ms
Write command 38 H(Do not detect busy signals)
Latency: 5 ms
Write command 38 H(Do not detect busy signals)
Write commands, read/All write operations require detection of busy signals
Write command 38 H: Display Mode settings
Write command 08 h: Show off
Write command 01 H: Display clear screen
Write command 06 h: Display cursor movement settings
Write command 0ch: Show on and cursor settings