100% found this document useful (2 votes)
53 views11 pages

Liquid Crystal Display

The document summarizes the key aspects of liquid crystal displays (LCDs) including how they work, their pins and functions, basic commands, initialization, and contrast control. LCDs are finding widespread use replacing LED displays because they can display numbers, characters, and graphics unlike LEDs. They have pins to control functions like power, ground, contrast, data transfer, and more. Basic commands are used to clear the display, set the display mode, and control the cursor. Initialization ensures the LCD is properly configured after power on. Contrast is adjusted using a preset/potentiometer to vary the voltage.

Uploaded by

Akhila
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
53 views11 pages

Liquid Crystal Display

The document summarizes the key aspects of liquid crystal displays (LCDs) including how they work, their pins and functions, basic commands, initialization, and contrast control. LCDs are finding widespread use replacing LED displays because they can display numbers, characters, and graphics unlike LEDs. They have pins to control functions like power, ground, contrast, data transfer, and more. Basic commands are used to clear the display, set the display mode, and control the cursor. Initialization ensures the LCD is properly configured after power on. Contrast is adjusted using a preset/potentiometer to vary the voltage.

Uploaded by

Akhila
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

LIQUID CRYSTAL DISPLAY

LIQUID CRYSTAL DISPLAY:

LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing LEDs
(seven segment LEDs or other multi segment LEDs) because of the following reasons:

1. The declining prices of LCDs.


2. The ability to display numbers, characters and graphics. This is in contrast to LEDs,
which are limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the 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 the data.
4. Ease of programming for characters and graphics.

These components are “specialized” for being used with the microcontrollers, which

means that they cannot be activated by standard IC circuits. They are used for writing

different messages on a miniature LCD.

A model described here is for its low price and great possibilities most frequently used in

practice. It is based on the HD44780 microcontroller (Hitachi) and can display messages in

two lines with 16 characters each . It displays all the alphabets, Greek letters, punctuation

marks, mathematical symbols etc. In addition, it is possible to display symbols that user

makes up on its own. Automatic shifting message on display (shift left and right), appearance

of the pointer, backlight etc. are considered as useful characteristics.


PINS FUNCTIONS

There are pins along one side of the small printed board used for connection to the

microcontroller. There are total of 14 pins marked with numbers (16 in case the background

light is built in). Their function is described in the table below:

Function Pin Number Name Logic State Description

Ground 1 Vss - 0V

Power supply 2 Vdd - +5V

Contrast 3 Vee - 0 - Vdd

0 D0 – D7 are interpreted as commands


4 RS
1 D0 – D7 are interpreted as data

0 Write data (from controller to LCD)


5 R/W
Control of 1 Read data (from LCD to controller)
operating
Access to LCD disabled
0
Normal operating
6 E 1
Data/commands are transferred to
From 1 to 0
LCD

7 D0 0/1 Bit 0 LSB

8 D1 0/1 Bit 1

9 D2 0/1 Bit 2

10 D3 0/1 Bit 3
Data / commands
11 D4 0/1 Bit 4

12 D5 0/1 Bit 5

13 D6 0/1 Bit 6

14 D7 0/1 Bit 7 MSB


LCD SCREEN:

LCD screen consists of two lines with 16 characters each. Each character consists of

5x7 dot matrix. Contrast on display depends on the power supply voltage and whether

messages are displayed in one or two lines. For that reason, variable voltage 0-Vdd is applied

on pin marked as Vee. Trimmer potentiometer is usually used for that purpose. Some

versions of displays have built in backlight (blue or green diodes). When used during

operating, a resistor for current limitation should be used (like with any LE diode).
LCD BASIC COMMANDS

All data transferred to LCD through outputs D0-D7 will be interpreted as commands
or as data, which depends on logic state on pin RS:

RS = 1 - Bits D0 - D7 are addresses of characters that should be displayed. Built in processor


addresses built in “map of characters” and displays corresponding symbols. Displaying
position is determined by DDRAM address. This address is either previously defined or the
address of previously transferred character is automatically incremented.

RS = 0 - Bits D0 - D7 are commands which determine display mode. List of commands


which LCD recognizes are given in the table below:

Command RS RW D7 D6 D5 D4 D3 D2 D1 D0 Execution Time

Clear display 0 0 0 0 0 0 0 0 0 1 1.64mS

Cursor home 0 0 0 0 0 0 0 0 1 x 1.64mS

Entry mode set 0 0 0 0 0 0 0 1 I/D S 40uS

Display on/off control 0 0 0 0 0 0 1 D U B 40uS I/D


1=
Cursor/Display Shift 0 0 0 0 0 1 D/C R/L x x 40uS Incr
eme
Function set 0 0 0 0 1 DL N F x x 40uS nt
(by
Set CGRAM address 0 0 0 1 CGRAM address 40uS 1)

Set DDRAM address 0 0 1 DDRAM address 40uS

Read “BUSY” flag (BF) 0 1 BF DDRAM address -


R/L
Write to CGRAM or DDRAM 1 0 D7 D6 D5 D4 D3 D2 D1 D0 40uS 1=
Shift
Read from CGRAM or DDRAM 1 1 D7 D6 D5 D4 D3 D2 D1 D0 40uS right

0 = Decrement (by 1) 0 = Shift left


S 1 = Display shift on DL 1 = 8-bit interface

0 = Display shift off 0 = 4-bit interface

D 1 = Display on N 1 = Display in two lines

0 = Display off 0 = Display in one line

U 1 = Cursor on F 1 = Character format 5x10 dots

0 = Cursor off 0 = Character format 5x7 dots

B 1 = Cursor blink on D/C 1 = Display shift

0 = Cursor blink off 0 = Cursor shift

LCD CONNECTION

Depending on how many lines are used for connection to the microcontroller, there

are 8-bit and 4-bit LCD modes. The appropriate mode is determined at the beginning of the

process in a phase called “initialization”. In the first case, the data are transferred through

outputs D0-D7 as it has been already explained. In case of 4-bit LED mode, for the sake of

saving valuable I/O pins of the microcontroller, there are only 4 higher bits (D4-D7) used for

communication, while other may be left unconnected.

Consequently, each data is sent to LCD in two steps: four higher bits are sent first

(that normally would be sent through lines D4-D7), four lower bits are sent afterwards. With

the help of initialization, LCD will correctly connect and interpret each data received.

Besides, with regards to the fact that data are rarely read from LCD (data mainly are

transferred from microcontroller to LCD) one more I/O pin may be saved by simple
connecting R/W pin to the Ground. Such saving has its price. Even though message

displaying will be normally performed, it will not be possible to read from busy flag since it

is not possible to read from display.

LCD INITIALIZATION

Once the power supply is turned on, LCD is automatically cleared. This process lasts

for approximately 15mS. After that, display is ready to operate. The mode of operating is set

by default. This means that:

1. Display is cleared

2. Mode

DL = 1 Communication through 8-bit interface

N = 0 Messages are displayed in one line

F = 0 Character font 5 x 8 dots

3. Display/Cursor on/off

D = 0 Display off

U = 0 Cursor off

B = 0 Cursor blink off

4. Character entry
ID = 1 Addresses on display are automatically incremented by 1

S = 0 Display shift off

Automatic reset is mainly performed without any problems. Mainly but not always! If

for any reason power supply voltage does not reach full value in the course of 10mS, display

will start perform completely unpredictably. If voltage supply unit can not meet this condition

or if it is needed to provide completely safe operating, the process of initialization by which a

new reset enabling display to operate normally must be applied.

Algorithm according to the initialization is being performed depends on whether

connection to the microcontroller is through 4- or 8-bit interface. All left over to be done after

that is to give basic commands and of course- to display messages.


Fig: Procedure on 8-bit initialization.

CONTRAST CONTROL:

To have a clear view of the characters on the LCD, contrast should be adjusted. To
adjust the contrast, the voltage should be varied. For this, a preset is used which can behave
like a variable voltage device. As the voltage of this preset is varied, the contrast of the LCD
can be adjusted.
Fig: Variable resistor

Potentiometer

Variable resistors used as potentiometers have all three terminals connected.

This arrangement is normally used to vary voltage, for example to set the switching point of a circuit
with a sensor, or control the volume (loudness) in an amplifier circuit. If the terminals at the ends of
the track are connected across the power supply, then the wiper terminal will provide a voltage
which can be varied from zero up to the maximum of the supply.

Potentiometer Symbol

Presets

These are miniature versions of the standard variable resistor. They are designed to be
mounted directly onto the circuit board and adjusted only when the circuit is built. For example to
set the frequency of an alarm tone or the sensitivity of a light-sensitive circuit. A small screwdriver or
similar tool is required to adjust presets.

Presets are much cheaper than standard variable resistors so they are sometimes used in projects
where a standard variable resistor would normally be used.
Multiturn presets are used where very precise adjustments must be made. The screw must
be turned many times (10+) to move the slider from one end of the track to the other, giving
very fine control.

Preset Symbol

LCD INTERFACING WITH THE MICROCONTROLLER

Vcc

P2.0 4 (RS) 1
Gnd
P2.1 5 (R/W) 2

P2.2 6(EN) 3
PRESET

(CONTRAST
CONTROL)
LCD

Vcc FOR BACKLIGHT


Gnd PURPOSE

89C51 P1.0 D0

P1.1 D1

P1.2 D2

P1.3 D3

P1.4 D4

P1.5 D5 15

P1.6 D6 16

P1.7 D7

You might also like