2. LCD stands for liquid crystal display
Generally LCD is also called as alpha numeric display
• Because by using LCD we can display alphabets as well as numeric
values
In general we have LCD’s in so many sizes
• 16 x 2
• 16 x 4
• 32 x 2
• 32 x 4
But the size of the LCD will doesn’t matter all LCD displays will
have same type of GPIO pins (16 pins)
We can able to interface LCD to any device through this pins
4. We can operate the LCD in 2 modes
• 8 bit mode
We have to use 8 data lines during the program
• 4 bit mode
We have to use only 4 data lines during the program
(d4, d5, d6, d7)
In order to operate LCD we must have to
send 2 types of data
Command
Used to give any instruction to LCD
Text
Message what we actually want to display
5. LCD will have total 16 pins
• 10 programmable pin’s
• 6 hardware pin’s
6. Hardware pins
• Pin_1 – ground
• Pin_2 – vcc
These 2 pins are used to apply power to the lcd
• Pin_15 – vcc
• Pin_16 – ground
These 2 pin’s are used to apply power to the back light
• Pin_3 – contrast
This pin is used to control the brightness of the massage
displayed on the LCD
Contrast pin is connected to 10k potentiometer
• Pin_5 – read / write
This pin is used to operate LCD in read mode or write mode
But we never going to operate LCD in read mode we always use
write mode
So we will connect this pin to ground (active low)
7. Programmable pin’s
• Pin_4 – RS
Rs stands for register select
Rs = 0
Received data is command
Rs = 1
Received data is text
• Pin_6 – en
En stands for enable
During the program for each 8bit data transmission we
should enable the enable pin and disable the enable pin
• Pin_7 to pin_14
These 8 pins are called as data pins we can pass the
data to the LCD through this pin’s
8. Sr.No. Hex Code Command to LCD instruction Register
1 0X01 Clear display screen
2 0X02 Return home
3 0X04 Decrement cursor (shift cursor to left)
4 0X06 Increment cursor (shift cursor to right)
5 0X05 Shift display right
6 0X07 Shift display left
7 0X08 Display off, cursor off
8 0X0A Display off, cursor on
9 0X0C Display on, cursor off
9. Sr.No. Hex Code Command to LCD instruction Register
10 0X0E Display on, cursor blinking
11 0X0F Display on, cursor blinking
12 0X10 Shift cursor position to left
13 0X14 Shift cursor position to right
14 0X18 Shift the entire display to the left
15 0X1C Shift the entire display to the right
16 0X80 Force cursor to beginning ( 1st line)
17 0XC0 Force cursor to beginning ( 2nd line)
18 0X38 2 lines and 5×7 matrix in 8 bit mode
19 0X28 2 lines and 5×7 matrix in 4 bit mode