This document describes the Lumex LCM-S01602DSR/F-Y LCD that is part of the Nios Excalibur kit.It also includes a sample program that implements the driver to control the LCD.
Pin
|
Name
|
Description
|
RS
|
Register
Select
|
Used
as register selection input. When RS = "High", Data register is selected.
When RS = "Low", Instruction register is selected.
|
R/W
|
Read/Write
|
Used
as read/write selection input. When R/W = "High", read operation.
When R/W = "Low", write operation. |
E
|
Enable
|
Read/write
enable signal.
|
DB0-7
|
Data
Pins
|
The
data that is sent to the LCD hardware.
|
Initialization of LCD
The LCD must be initialized before it can be used.The following diagram illustrates the initialization steps.
Function Set
-determines 1 or 2 line mode
-determines font type
Display On/Off
-turns display on
Display Clear
-clears the display
Entry Mode Set
-determines if the cursor shifts left to right or vice versa
-determines if the letters currently on display shifts with the cursor
or not
Writing an Instruction to LCD
An instruction is written to the LCD as follows.
-Set RS to 0 (meaning you're writing an instruction).
-Set R/W to 0 (selecting 'write' mode).
-Set the instruction code onto DB0-7.
-A falling edge on E (enable) indicates to the LCD to read the next instruction.
-Each instruction requires a certain amount of time to process, from 39 us to 1.58 ms. Thus, you must wait for this time to elapse before you write another instruction command.
Writing Data to LCD
Data is written to the LCD as follows.
-Set RS to 1 (meaning you're writing data).
-Set R/W to 0 (selecting 'write' mode).
-Set the character bit representation (i.e. '01000001' for 'A') onto DB0-7. All the characters can be found in the CGROM table.
-A falling edge on E (enable) indicates to the LCD to read the next data instruction.
-Each data instruction takes a certain amount of time (about 39 us).
Thus, you must wait for this time to elapse before you write another data
instruction.
Included is code that implements the LCD driver. To help one understand the code, the state diagram the code implements is shown below.
Also displayed below is a description of the inputs and outputs of the LCD driver.
'message' is the symbol that is sent to the LCD driver that is to be displayed on the LCD.
'enable' is sent to the LCD driver telling the LCD driver to take in a message.
Outputs:
'lcd_data' is the output to the actual LCD hardware which tells the LCD which symbol to display.
'lcd_rs' selects the register for which lcd_data should be stored in the LCD hardware.It should be low if the data is an instruction and high if the data is actually a symbol to displayed.
'lcd_rw' selects read or write mode for the LCD hardware.
'lcd_enable' enables the LCD and its falling edge indicates to the LCD that a next instruction is coming.
Optional Outputs (used for demonstration and testing):
'LED1' and 'LED2' are used to display which state the LCD driver is in.
debouncer.vhd (used to debounce the push buttons)
LCDdriver.vhd (the LCD driver)
LCD.vhd (the top level)
SLG_pkg.vhd (package that contains the clk_divider and debouncer)
LCD_pkg.vhd (package that contains the LCD_driver)
LCD.csf (the pin assignment file)
Samsung S6A0069 IC Controller Specifications
Simple to use LCD driver (DMC 16207). David Li, Eric Cheung, Felicia Cheng and Wilson Kwan. www.ee.ualberta.ca/~elliott/ee552/studentAppNotes/2000_w/interfacing/lcd_driver/lcd.htm
How To Write To An LCD With Minimal Pain and Anguish. Jeremy Kierstead and Dave McMillan.www.ee.ualberta.ca/~elliott/ee552/studentAppNotes/1997f/lcd/lcd.html