Академический Документы
Профессиональный Документы
Культура Документы
PROBLEM STATEMENT:
Interface 16x2 LCD to PIC Microcontroller in 8-bit Mode. Write a program in Embedded
C to display user defined messages on LCD without using standard library functions.
OBJECTIVE :
a. To understand the working of Liquid Crystal Display (LCD).
b. To study the LCD interfacing modes and Timing diagram.
c. To study and use of the LCD commands to drive LCD.
d. To interface LCD in 8-bit mode to PIC Microcontroller
THEORY
1. LCD Interfacing
In recent years the LCD is finding widespread use replacing LED’s. This is due to the
following reason:
1. The declining prices of LCD.
2. The ability to display numbers, characters, and graphics. This is in contrast to LEDs,
which are limited to numbers and few characters.
3. In corporation of a refreshing controller into the LCD, thereby reliving 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.
Most of LCD’s available in the market are based on controller HD44780. The LCD
display can be interfaced either in 4-bit interface or 8-bit interface mode.
E&TC
BVCOEL
E&TC
BVCOEL
E&TC
BVCOEL
3. Algorithm
1. As LCD data bus is connected to PORTD and handshaking signal EN-RE0, RS-RE1, E-
RE2, configure these pins output writing 0x00 to the appropriated TRES register.
2. The RE0, RE1, RE2 this pins have dual function (analog/digital), by default on every
reset it work as analog input. So make this pin as digital by using ADCON1 register.
3. Initialize LCD.
a. Write a commands {2 line and 5X7 matrix (0x38), Display ON cursor OFF (0x0C),
Increment & shift cursor right (0x06), Clear display screen (0x01) to LCD}.
E&TC
BVCOEL
E&TC