LCD1602 pin function

1602 adopts the standard 16-pin interface, which:

Pin 1: GND for the power supply ground

Pin 2: VCC connected to the 5V power supply positive

Pin 3: V0 for the LCD contrast adjustment terminal, connected to the positive power supply when the contrast is the weakest, the ground power supply when the contrast is the highest (too high a contrast will produce a "ghost", you can use a 10K potentiometer to adjust the contrast). "ghosting", the use of a 10K potentiometer can be used to adjust the contrast).

Pin 4: RS is for register selection, high level 1 selects the data register, low level 0 selects the instruction register.

Pin 5: RW is read/write signal line, high level (1) for read operation, low level (0) for write operation.

Pin 6: E (or EN) terminal is the enable terminal, high level (1) to read the information, negative jump

execute the instruction.

Pins 7 to 14: D0 to D7 are 8-bit bidirectional data terminals. Pins 15 to 16: Empty pin or backlight electric

source. 15 pins backlight positive, 16 pins backlight negative.

Features

3.3V or 5V operating voltage, adjustable contrast

Internal reset circuit

Provides a variety of control commands, such as: clear the screen, the character blinking, the cursor blinking, the display shifts a variety of functions

There are 80 bytes of display data memory DDRAM

There is a built-in 192 5 X 7 dot matrix

Built-in 192 5x7 dot matrix character generator CGROM

8 user-definable 5x7 character generator CGRAM

Featured Applications

Micro-power consumption, small size, rich display content, ultra-thin and lightweight, commonly used in pocket-sized instrumentation and low-power application systems.

Operation Control

Note: Regarding the E=H pulse - initialize E to 0 at the beginning and then set E to 1.

Character Set

The character generating memory (CGROM) inside the 1602 LCD module has stored 160 different dot-matrix characters graphic We can see the letter "A".

In microcontroller programming, you can also use character constants or variables, such as 'A'. Because the character code stored in CGROM is basically the same as the character code in our PC, we can even use P1='A' when we write a C51 character code program to the DDRAM, and the PC will convert the 'A' to 41H code when it is compiled.

Character code 0x00~0x0F is the user-defined character graphics RAM (for 5X8 dot matrix characters, you can store 8 groups, for 5X10 dot matrix characters, store 4 groups), which is CGRAM.

0x20 to 0x7F are standard ASCII codes, 0xA0 to 0xFF are Japanese characters and Greek characters, and the rest of the character codes (0x10 to 0x1F and 0x80 to 0x9F) are not defined.

The following is the address of the hexadecimal ASCII code table for 1602: when reading, read the top row first, then the left column, e.g., exclamation point! has an ASCII of 0x21, and the letter B has an ASCII of 0x42 (preceded by 0x for hexadecimal).

Instruction Set

Instruction Code

Function Order:RSR/WD7D6D5D4D3D2D1D0 Say Mingqing Display 0 000000001 Fill the DDRAM with 20H,and set the DDRAM's Address Counter (AC) to 00H to return to the position 000000001* Set the DDRAM's Address Counter (AC ) to 00H, and move the cursor to the beginning home position; this instruction does not change the content of the DDRAM Display Switch Control Instruction 0 000001DCB [D=1: Overall Display ON], [C=1: Cursor ON], [B=1: Cursor Position Highlighting Allowed] Entry Mode Setting Instruction 00000001I/D S I/D=1, the cursor or blinking move to the right, AC I/D=0, cursor or blinking moves to the left, AC decreases by 1, S the whole display moves Cursor or display shift instruction 000001S/CR/L** Cursor or display shift instruction enables the cursor or display to move to the left or right without reading or writing the data, the instruction doesn't change the content of the DDRAM Function Setting 00001DLNF**[DL=0/1:4/ 8-bit data],[N=0/1, single line/double line display],[F=0/1, 5*8/5*10 dot matrix display mode] Setting the CGRAM address 0001AC5AC4AC3AC2AC1AC0CGRAM Address Setting Instruction Sets the CGRAM address pointer and sets the DDRAM address. 0010AC5AC4AC3AC2AC1AC0DDRAM Address Setting Instruction sets the DDRAM address. One line address range 00H~4FH,two lines DDRAM address first line 00H~27H,second line 40H~67H,plus high 2 bits, [one line: 80H-A7H], [two lines: C0H-E7H] Read Busy flag and address 0 1BF AC6AC5AC4AC3AC2AC1AC0BF: Busy flag bit,BF=1, the module is performing internal operation, at this time, the module does not accept any external instructions and data.BF=0, the module can accept external instructions and data; at the same time, it can read the value of the address counter (AC). Write RAM instruction 10D7D6D5D4D3D2D1D0 Write data D7-D0 to internal RAM (DDRAM/CGRAM/IRAM/GRAM),Write user-defined characters into CGRAM,D7~D5 is 000,D4~D0 is 5-dot word mode data Read RAM instruction 11D7D6D5D4D3D2D1D0 Read data D7--D0 from internal RAM (DDRAM/CGRAM/IRAM/GRAM)