Friday, June 19, 2009

LIQUID CRYSTAL DISPLAY INTERFACE ( Part 1 )

Liquid Crystal Display ( LCD ) are now available which are inexpensive, display alphanumeric character, require only 14 wires for connection and are simple to use. They come 16 to as many as 40 characters wire and 1,2, or 4 lines high.

1 x 16 LCD
The 1 line by 16 character display ( produced by some manufactures ) is controlled by a Hitachi HD44780 LCD controller chip which is surface mounted on the back side of the display module’s printed circuit board. The HD44780 display controller is commonly used in a variety of liquid crystal display made by manufacturers such as Hitachi, Optrex, Amperex, Densitron and Epson. The following description will apply in a general way to similar displays made by these manufacturers.





PIN & FUNCTION

1 GND Connect to Ground
2 +5V Connect to Power supply +5V
3 Vref Brightness Control Voltage
4 RS ( Register Select ) control line
5 R / W Read / Write Control – connect to ground for simple app.
6 E Enable control line
7 D0 Data 0 line
8 D1 Data 1 line
9 D2 Data 2 line
10 D3 D ata 3 Line
11 D4 Data 4 line
12 D5 Data 5 line
13 D6 Data 6 line
14 D7 Data 7 line

15 + Back light ( + )
16 - Back light ( - )


The display module has 3 control lines. RS makes the selection of instructions vs data and may be thought of as an address line which select either the control register or the data Register.
The R/W line set up for read vs write. For this application the display will be written to only, so this line brought to ground. E enable the display registers for a write operation when High.

Port Bit(s) Function
B0 – 7 Data
A 2 RS ( Register Select )
A 1 E ( Enable )


Data VS Instruction
There are 2 port and some timing involved in controlling the display. The display control lines are set up before sending either an instruction word or a data word. The RS line is asserted 0 for sending an instruction or 1 for sending data.


Function for sending RS
Instruction 0
Data 1

This must be done in advance of pulsing the enable line high. Also the data or instruction byte must be stable at port B prior to pulsing the enable line High.









Display Control
Instruction words are sent to the display to tell it what mode to operate in.

Operation Instruction word Function
Function Set 0x38 8bit, 5x7
Used at initial only
Display on/off 0x0C Display on,no cursor
0x0F Display on, cursor blink
Clear Display 0x01 Clear Display = Blanks
Entry Mode Set 0x06 Increment Mode



Character Addresses
Each of the 16 display characters has an address. This tells the display controller where to put the next character data byte.





We will need some code to initialize the display to test the demonstation circuit. This will consist of a short main program which delay 5 miliseconds to allow the LCD microcontroller time to get itself organized after power-on reset ( essential ), an initialization routine for sending the LCD its operation mode instruction and a second 5 ms delay .
( Continue next ……see u ….)

Source : Pic’n Up the Pace


Download PDF


No comments: