The LCD interface has become very simple. The LCD along with necessary controller (LCD Controller) and mounting facility is made available in the module itself. The LCD controller takes care of everything necessary for the LCD.
The LCD module consist of the LCD and controller (LCD controller). The LCD controller has Display Data RRAM (DDRAM), Character Generator ROM (CGROM), Instruction Register (IR), AND Address Counter (AC).
DDRAM has a capacity of 80 bytes and it holds the display data. DR register temporarily holds the display data before writing it to DDRAM. You can read/write from the DDRAM. The capacity of CGROM is 9920 bits for 240 characters. It holds the pixel details of each ASCII Charcater in two different formats, 5 x 8 dots and 5 x 10 dots.
The LCD controller gets data from the DDRAM, which is an ASCII values of a character and reads the equivalent display data from the CGRAM and sends it to the LCD for displaying.
The communication with the LCD module is through the IR and DR registers. The IR register stores the Instruction codes like clear display, cursor shift and etc. When an address is written into IR, it is sent to the Address Counter (AC).
One of the most common displays is the Liquid Crystal Display (LCD) system which capable of giving the output in the alpha numeric form. The LCD in finding widespread use replacing LEDs Display are some reasons below
- LCD Module is low cost.
- The ability to display number, characters, and graphics.
- Ease of programming for characters and graphics.
The LCD MODULE CONFIGURATIONS ARE: LCD 16×2 JHD-162A-datasheet.
1 Line x 16 Characters
2 Line x 16 Characters
4 Line x 16 Characters
4 Line x 20 Characters
LCD PIN Details:- VCC,VSS AND VEE
While Vcc and Vss provide +5 v and ground respectively, Vee is used for controlling LCD contrast.
How to test LCD DISPLAY?
1. Connect 5v Dc power supply to vcc pin 2 (+) Lcd display
2. Connect Negative Ground to vss pin 1 (-) Lcd display without any i/o connections, that LCD Back light only ON.
3. Connect a Trimpot (pot – Variable resistor 10k) To vEE pin 3 with 5v power supply as in the diagram, and by changing the value of the Trimpot the LCD contrast also changed.
Verification:- By this testing that LCD DISPLAY is GOOD condition.
If you want LCD Background light to glow, Connect + 5v Dc to the pin 15 with current limiting resistor 100 Ohms to 220 Ohms and Negative supply to pin 16.
RS, Register Select The two registers is important. The RS pin is used for their selection as follows. If RS=0, the instruction command code register is selected, allowing the user to send a command such as clear display, curser at home etc. If Rs=1 the data register is selected allowing the user to send data to be displayed on the LCD.
R/W Read/Write. R/W input allows the user to write information to the LCD OR READ INFORMATION FROM IT. R/W=1 when reading R/W =0 when writing.
E, ENABLE. The enable pin is used by the LCD to latch information presented to its data pins. When data is supplied to data pins, a high-to-low pulse must be applied to this pin in order for the LCD to latch in the data present at the data pins. This pulse must be a minimum of 450 ns wide.
Pin Sysbol I/O Description
1 Vss — Ground
2 Vcc — + 5V
3 Vee — + ve to Contrast
4 RS I RS=0 TO Select Command Register
RS=1 TO Select data Registoer
5 R/W I R/W=0 For write
6 E I/O Enable
7 DB0 I/O 8 Bit Data Bus
8 DB1 I/O 8 Bit Data Bus
9 DB2 I/O 8 Bit Data Bus
10 DB3 I/O 8 Bit Data Bus
11 DB4 I/O 8 Bit Data Bus
12 DB5 I/O 8 Bit Data Bus
13 DB6 I/O 8 Bit Data Bus
14 DB7 I/O 8 Bit Data Bus
15 Back (-) LED Lcd back Light If need
16 Back (+) LED Lcd back Light If need
D0-D7 The 8-bit data pins, D0-D7 are used to send information to the LCD or read the contents of the LCD’s inter registers.
LCD COMMAND CODES:-
Use RS=0 to check the busy flag bit to see if the LCD is ready to receive information. The busy flag is D7=1 (busy flag=1) the LCD is busy taking care of internal operations and will not accept any new information, When D7=0, the LCD is ready to receive new information.NOTE:- It is recommended to check the busy flag before writing any data to the LCD.
Code (Hex) Command to LCDs Instruction (Register).
01-Clear Display Screen
04-Decrement cursor (shift cursor to left)
05-Shift display right
06-Increment cursor (shift cursor to right)
07-Shift display left
08-Display off,cursor off
0A-Display off, cursor on
0C-Display on, cursor off
0E-Display on, cursor on
0F-Display on, cursor Blinking
10-Shift cursor position to left
14-Shift cursor position to right
18-Shift the entire display to the left
1C-Shift the entire display to the right
80-Force cursor to beginning of 1 st line
C0-Force cursor to beginning of 2 st line
38-2 lines and 5 x 7 matrix
tpsw=Enable Pulse width = ns (minimum)
t DSW= Data set up time = 195 ns (minimum)
t H= Data hold time – 10ns (minimum)
tAS=Set up time prior to E (going high) for both RS and r/w = 140 ns
tah= Set up tiem prior to E (going) for both RS and R/W =140 ns
LCD INTERFACE PROGRAMME:–
Address, 74,81 90,a0,03 F0 74,38 71,38 71,50 74,0E 71,38 71,50 74,01 71,38 71,50 74,06 71,38 71,50 74,84 71,38 71,50 71,79 71,44 71,50 74,65 71,44 74,50 74,73 71,44 71,50 80,ff 90,A0,00 F0 74,04 A3 Fo 74,00 F0 22 90,A0,oo Fo 74,05 A3 Fo 74,01 Fo 22 7B,0A AC,FF DC,FE DB,FA 22.