17-03-2012, 11:11 AM
To interface LCD with ARM7 processor (LPC 2138/48)
AIM: - To interface LCD with ARM7 processor (LPC 2138/48)
APPARATUS: - ARM7 (LPC 2138/48) Development board,LCD interfacing kit.
SOFTWARE: - Keil/u vision 3 for programming,flash magic for downloading program to hardware.
THEORY:-
LCD pin description
LCD used here is JHD162A 16 pins.
VCC,VSS and VEE:-
VCC is provide +5v supply.
VSS is connected to ground.
VEE is used for controlling the contrast.
RS register select:-
There are two important registers inside LCD namely command and data.The RS pin is used for their selection.If RS=0,the instruction command code is selected allowing the user to send the command such as clear display,cursor at home etc.If RS=1 the data register is selected allowing user to send the data to displayed on LCD.
R/W read /write:-
R/W input allows to 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 LCD to latch information presented to it 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 pin.This pulse must be minimum of 450ns wide.
DATA PINS D0-D7:-
The 8-bit data pins D0-D7 are used to send information to the LCD or read the content of LCD’s internal register. To display letters and numbers,we send ASCII codes for the letter A-Z,a-z and numbers 0-9 to these pins while making RS=1.
There are also instruction command codes that can be send to the LCD to clear the display or force the cursor to the home position or blink the cursor.Task shows list of instruction command code.
We also used RS=0 to check the busy flag bit to see if the LCD is ready to receive the information.
The busy flag is D7 and can be read when R/W=1 AND RS=0.
If R/W=1,RS=0 and D7=0(busy flag=1) the LCD is busy taking care of internal operation and will not be accepted any new information.
When R/W=1,RS=0 and D7=0(busy flag=0)the LCD is ready to receive the new information.
NOTE:-
It is recommended to check the busy flag before writing any data to the LCD.