LCD INTERFACING
LCD
INTERFACING
8.1 LCD
Features
LCD stands for Liquid
Crystal Display are the most widely used output devices for 89c51 type
microcontroller. Nowadays LCDs is finding widespread use compared to LEDs and
7-segment. This is due to following specific features:
1. The declining prices
of LCDs make its use cost-effective.
2. The ability to
display numbers, characters and graphics. This is contrast to LEDs, which has
limited to numbers and few characters. Incorporation of a refreshing controller
into LCD, thereby relieving the CPU of the task of refreshing the LCD. In
contrast, the LED must be refreshed by the CPU to keep displaying data.
3. Ease of programming
for characters and graphics.
8.2 LCD Pin Descriptions
The LCD which we
have used in our TRAINER KIT is discussed in this section. It has 14 pins.
Figure shows the position of various pins.
1. VCC, VSS,
and VEE
While VCC and
VSS provide +5V and ground, respectively, VEE is used for controlling LCD
contrast.
2. RS (Register
Select)
There are two
very important registers inside the LCD. 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, cursor at home, etc.
If RS=1, the data register is selected, allowing the user to send data to be
displayed on LCD.
3. R/W
(Read/Write)
R/W input allows
the user to write information to LCD or read information from it. R/W=1 when
reading; R/W=0 when writing.
4. 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 the data pins. This pulse must
be a minimum of 450 ns wide.
5. D0-D7
(8-bit Data bus)
The 8-bit data
pins, D0-D7, are used to send information to the LCD or read the contents of
the LCD’s internal registers. To display letters and numbers, we send ASCII
codes for the letters A-Z, a-z, and numbers 0-9 to these pins while making RS=1.
There are also instruction command codes that can be sent to LCD to clear the
cursor to the home position or blink the cursor. Table lists some of the instruction
command codes.
8.3 Connection of
LCD with 8255
The main purpose
of LCD in our Trainer kit is to display the name of the practical which is
going to perform by the user and so LCD is programmed according. Figure shows
various connections required to interface an LCD to 89c51. Here data lines of
LCD are connected to 8 port of 89c51 microcontroller.
Interfacing
of LCD to Microcontroller
On this data lines, various command codes for
LCD settings and data codes which are required to display are sent. There are
three controlling lines for LCD viz, RS, R/W and E. RS that is register select
is connected to designated port pin of 89c51 and set or reset as required. Similarly
remaining two lines R/W that is Read/Write and E that is Enable are connected
to designated 89c51 port pins and set or reset as required.
Comments