Professional Documents
Culture Documents
Abstract
Liquid crystal displays (LCDs) are a passive display technology. This means they do not emit
light because they use the ambient light in the environment. By manipulating this light, they
display images using very little power. This has made LCDs the preferred technology whenever
low power consumption and compact size are critical. This application note explains how LCD is
used to display a character. The main scope of this application note is to describe how LCD
interfaces with microcontroller. It also will teach simple programming code for LCD interfacing.
Keywords
LCD
Introduction
In this application note liquid crystal display JHD 162A is used to interfacing with microcontroller.
In interfacing the LCD, the major task is the initialization sequence. Therefore we have to send
command bytes to the LCD to set the interface mode, display mode, address counter,
increment direction, set contrast of LCD and horizontal or vertical addressing mode.
Objective
signal
7 D0 Data Bit 0
8 D1 Data Bit 1
9 D2 Data Bit 2
10 D3 Data Bit 3
11 D4 Data Bit 4
12 D5 Data Bit 5
13 D6 Data Bit 6
14 D7 Data Bit 7
15 LED + 5 V of backlight Positive supply for
back light if available
16 LED - 0V of backlight
Circuit discription
Connect pins RS ,RW ,E ,D0 - D7 to pins on the micro controller and connect Data bus on port A
and the RS , RW , E on port B . We can save pins by using LCD in Nibble Mode (4 data pins )
and permanently grounding the RW line ( always in write mode ). To avoid losing battery we
can ignore the connection of pin 15 and 16 of the LCD.
Title : Interfacing LCD with microcontroller
Name: Siti Nor Nabilah binti Yahya
Date : 23 March 2009
void lcd_str(char *ptr) This is used to print a line while (*ptr != 0x00)
of text on the lcd lcd_write_byte(DATA,*ptr++);
void lcd_goto(unsigned char This is used to set the unsigned char addr;
column, unsigned char line) LCD's current cursor from line--;
where it will continue column--;
printing addr = (line * 0x40) + column;
This 40 is the address of lcd_write_byte(CTRL, addr | 0x80);
the next line to be added
it is OR'ed with 0x80 to
make the MSB 1 .
Conclusion
This application note has explained the detail how LCD can be interfacing by showing the circuit
diagram and the example and the description of simple c programming for the interfacing with
microcontroller.