0% found this document useful (0 votes)
93 views21 pages

LCD and Keyboard Interfacing

This document discusses interfacing an LCD display with a keyboard. It describes the benefits of LCD displays over LED displays, the pin descriptions and configurations for common LCD controllers, how to send commands and data to the LCD including checking the busy flag, addressing locations on the LCD, and creating custom characters. It provides example code and references for more information on LCD interfacing with microcontrollers.

Uploaded by

Ammar Ehab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views21 pages

LCD and Keyboard Interfacing

This document discusses interfacing an LCD display with a keyboard. It describes the benefits of LCD displays over LED displays, the pin descriptions and configurations for common LCD controllers, how to send commands and data to the LCD including checking the busy flag, addressing locations on the LCD, and creating custom characters. It provides example code and references for more information on LCD interfacing with microcontrollers.

Uploaded by

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

LCD AND KEYBOARD

INTERFACING (1)
LCD INTERFACING
Why LCD is widespread used?
• 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 (or in some other way) to keep
displaying the data.
• 4. Ease of programming for characters and graphics
LCD pin descriptions
Pin Positions for Various LCDs from Optrex
Hitachi HD44780 controller or compatible
LCD pin descriptions

• VCC = 5V & Vss = GND


• VEE controls LCD contrast
• RS, register selection. RS = 0, the instruction command code register is
selected, allowing the user to send a command such as clear display,
cursor at home, etc. RS = 1 the data register is selected, allowing the user
to send data to be displayed on the LCD.
• R/W: R/W = 0 write to the LCD & R/W = 1 read from the LCD
• E, enable (High-to-Low) to latch the data presents at data pins (D0-D7)
• DO - D7, are used to send information to the LCD or to read the contents
of the LCD’s internal registers.
Contrast control using Vee
• 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

• Instruction command codes


that can be sent to the LCD to clear the display or force the cursor to
the home position or blink the cursor..etc.
The busy flag

• How to read the busy flag?


RS = 0 (command register is selected) and R/W = 1 (read the
command register) – the busy flag is D7
• Meaning of busy flag
D7 = 1 LCD is busy and will not accept any new information
D7 = 0 LCD is ready to accept new information
• It is recommended to check the busy flag before writing any data to
the LCD
LCD Connections
Sending commands and data to LCDs with a
time delay
Sending code or data to the LCD with
checking busy flag
LCD Timing for Read ( L-to-H for E line)
LCD Timing for Write (H-to-L for E line)
LCD Addressing
• In the LCD, one can put data at any location. The LCD has 80 bytes
memory. Not all can be seen on the display. The following shows
address locations and how they are accessed.
Cursor Addresses for Some LCDs
Sending information to LCD using MOVC
instruction

• The Program 12-3 shows how to use the MOVC instruction to send
data and commands to an LCD. Error !!
• The MOVC instruction is used to get the massage to be displayed on
the LCD from the code memory ONLY.
• C version of LCD programming
Examples 12-1 and 12-2
CGROM - Character Generator ROM
5x8 -5x10
Creating custom character
• For more information:
https://www.8051projects.net/lcd-interfacing/
https://www.circuitstoday.com/interfacing-16x2-lcd-with-8051
https
://microcontrollerslab.com/interfacing-lcd-8051-mirocontroller-code/
https://www.electronicshub.org/interfacing-16x2-lcd-8051/

You might also like