LCD INTERFACE
Prepared by Duncan Campbell, Grant Cunningham, Clint Lozinsky, and Richard Schultz.
Audio Processing Unit


Contents:
Description
Connecting the LCD
LCD Operation
Code
References


Description:
This document describes how to interface an Emerging Displays Technologies Corporation 2 line by 24 character LCD with the XSA-100/XStend prototyping boards. The part number for the LCD is EW24210YR and it uses a Hitachi HD44780U Dot Matrix Liquid Crystal Display Controller/Driver. This driver is one that is commonly used in industry and therefore many of the instruction sets and much of the code discussed in this page will be similar to that used by other dot matrix LCD's.

This LCD is interfaced using a driver and a decoder. The driver communicates directly with the LCD in order to initialize it and print characters on the screen. The decoder excepts a message code from an external module and then passes the proper characters to the driver to create the desired message.
[Back to Top]



Connecting the LCD:
In order to connect the LCD to the XStend board a 2x11 pin connector was used to pass signals from the daughterboard connector (see page 15 of the XStend Board V1.3.2 Manual) to the LCD.  Not all of the pins on the 2x11 connector were used but in order to be able to connect to 11 unused pins a connector this wide was needed. The LCD voltage supply and ground pins were connected to +5V and ground jumpers on the XStend board. To control the contrast of the LCD a 10kΩ potentiometer was used to connect the contrast pin to the ground pin.  The pin assignments are shown in Table 1 below.

Pin number
Symbol
Level
I/O
Function
1 Vss - - Power supply (GND)
2 Vcc - - Power supply (+5V)
3 Vee - - Contrast adjust
4 RS 0/1 I 0 = Instruction input
1 = Data input
5 R/W 0/1 I 0 = Write to LCD module
1 = Read from LCD module
6 E 1, 1-->0 I Enable signal
7 DB0 0/1 I/O Data bus line 0 (LSB)
8 DB1 0/1 I/O Data bus line 1
9 DB2 0/1 I/O Data bus line 2
10 DB3 0/1 I/O Data bus line 3
11 DB4 0/1 I/O Data bus line 4
12 DB5 0/1 I/O Data bus line 5
13 DB6 0/1 I/O Data bus line 6
14 DB7 0/1 I/O Data bus line 7 (MSB)
Table 1: Pin Assignment for EW24210YR LCD.

[Back to Top]



LCD Operation:
We will first review some of the basic commands and traits of this LCD:

In order for the LCD to function correctly it must first be initialized. Figure 1 below is taken from the HD44780U manual and it shows the commands that must be implemented in order to initialize the LCD.

Initalizaiton Commands
Figure 1: 8-bit Initialization Commands.

Figure 2 is also taken from the HD44780U manual and it shows the execution times of the various commands. Since the LCD busy flag is not being read between instructions, in order to increase the simplicity of the code, one must ensure that there is a long enough delay between commands so that they do not interfere with each other.

Execution Times
Figure 2: Execution Times for HD44780U.

[Back to Top]


Code:

Table 2 below lists all of the code and provides a brief description of the various modules.

Module Description
interface.vhd
Package definition, containing all necessary components.
lcd_top_level.vhd
Top level definition, passes the proper signals to LCD, the driver, and the decoder.
clock_divider.vhd
Generic clock divider, initially designed for EE 480.
lcd_decoder.vhd
Receives the message code and outputs the proper characters to the driver.
lcd_driver.vhd
Initializes display and implements commands received from the decoder.
Table 2: List of Developed Code.

[Back to Top]


References:

[1] HD44780U data sheets, Hitachi.
http://www.x-robotics.com/downloads/datasheets/hitachi44780.pdf


[2] Text Messaging Center, Alan Mak, Ben Lee, Wing Yee Chan, Christina Kwok.
http://www.ee.ualberta.ca/~elliott/ee552/studentAppNotes/2001f/interfacing/LCD/lcdappnote.html

[3] How to Control a HD44780-based Character-LCD, Peer's LCD Pages.
http://home.iae.nl/users/pouweha/lcd/lcd.shtml

[Back to Top]