HOW 16x2 ALPHANUMERIC LCD WORKS ?
LCD (Liquid Crystal Display) is used in all the electronics projects to display the status of the process. A 16x2 alphanumeric LCD is most widely used module of LCD nowadays. There are several others type of LCD available in market also.
The reason for choosing LCD over other display component or devices is that it is
- Low cost
- Easily programmable
- Large number of display character etc.
Introduction :
16x2 LCD has 2 horizontal line which comprising a space of 16 displaying character. It has two type of register inbuilt that is
- Command Register
- Data Register.
Command register is used to insert a special command into the LCD. While Data register is used to insert a data into the LCD. Command is a special set of data which is used to give the internal command to LCD like Clear screen, move to line 1 character 1, setting up the cursor etc.
Pin Diagram of 16x2 LCD :
Sr. No
|
Pin No.
|
Pin Description
|
1
|
Pin 1 (GND)
|
This is a ground pin to apply a ground to LCD.
|
2
|
Pin 2 (VCC)
|
This is the supply voltage pin to apply voltage to LCD.
|
3
|
Pin 3 (VEE)
|
This is the pin for adjusting a contrast of the LCD display by attaching a veriable resistor in between VCC and GND.
|
4
|
Pin 4 (RS)
|
RS stands for Register Select. This pin is used to select command/data register.
If RS=0 then command register is selected.
If RS=1 then data register is selected.
|
5
|
Pin 5 (R/W)
|
R/W stands for Read/Write. This pin is used to select the operation Read/Write.
If R/W=0 then Write operation is performed.
If R/W=1 then Read operation is performed.
|
6
|
Pin 6 (EN)
|
En stand for Enable signal. A positive going pulse on this pin will perform a read/write function to the LCD.
|
7
|
Pin 7-14 (DB0-DB7)
|
This 8 pin is used as a Data pin of LCD.
|
8
|
Pin 15 (LED+)
|
This pin is used with pin 16(LED-) to setting up the illumination of back light of LCD. This pin is connected with VCC.
|
9
|
Pin 16 (LEC-)
|
This pin is used with pin 15(LED+) to setting up the illumination of back light of LCD. This pin is connected with GND.
|
Important commands codes for LCD :
Sr.No.
|
Hex Code
|
Command to LCD instruction Register
|
1
|
01
|
Clear display screen
|
2
|
02
|
Return home
|
3
|
04
|
Decrement cursor (shift cursor to left)
|
4
|
06
|
Increment cursor (shift cursor to right)
|
5
|
05
|
Shift display right
|
6
|
07
|
Shift display left
|
7
|
08
|
Display off, cursor off
|
8
|
0A
|
Display off, cursor on
|
9
|
0C
|
Display on, cursor off
|
10
|
0E
|
Display on, cursor blinking
|
11
|
0F
|
Display on, cursor blinking
|
12
|
10
|
Shift cursor position to left
|
13
|
14
|
Shift cursor position to right
|
14
|
18
|
Shift the entire display to the left
|
15
|
1C
|
Shift the entire display to the right
|
16
|
80
|
Force cursor to beginning to 1st line
|
17
|
C0
|
Force cursor to beginning to 2nd line
|
18
|
38
|
2 lines and 5x7 matrix
|