beautypg.com

Digilent DIO5 User Manual

Page 4

background image

DIO5 Reference Manual

Digilent, Inc.

www.digilentinc.com

Page

4

Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.

LCD

The DIO5 uses a Powertip 16x2 LCD module
(P/N PC1602ARS-DWA-A) with a Samsung
KS0066U controller (data sheets are available
at the Digilent website).

The KS0066U contains a character-generator
ROM (CGROM) with 208 preset 5x8 character
patterns, a character-generator RAM
(CGRAM) that can hold 8 user-defined 5x8
characters, and a display data RAM (DDRAM)
that can hold 80 character codes. Character
codes written into the DDRAM serve as
indexes into the CGROM (or CGRAM). Writing
a character code into a particular DDRAM
location will cause the associated character to
appear at the corresponding display location.
Display positions can be shifted left or right by
setting a bit in the instruction register (IR). The
write-only IR directs display operations (such
as clear display, shift left or right, set DDRAM
address, etc). Available instructions (and the
associated IR codes) are shown in the right-
most column of table 3 below. A busy flag
shows whether the display has competed the
last requested operation; prior to initiating a
new operation, the flag can be checked to see
if the previous operation has been completed.

The display has more DDRAM locations than
can be displayed at any given time. DDRAM
locations 00H to 27H map to the first display
row, and locations 40H to 67H map to the
second row. Normally, DDRAM location 00H
maps to the upper left display corner, and 40H
to the lower left. Shifting the display left or right
can change this mapping. The display uses a
temporary data register (DR) to hold data
during DDRAM /CGRAM reads or writes, and
an internal address register to select the RAM
location. Address register contents, set via the

IR, are automatically incremented after each
read or write operation. The LCD display uses
ASCII character codes. Codes up through 7F
are standard ASCII (which includes all “normal”
alphanumeric characters). Codes above 7F
produce various international characters –
please see the manufacturers data sheet for
more information on international codes.

The display is connected to the DIO5 board by
a 16-pin connector (pins 15 and 16 are for an
optional backlight, and they are not used). The
14-pin interface includes eight data signals,
three control signals, and three voltage supply
signals. The eight data bus signals are passed
through the CPLD to/from the system bus for
read/write cycles directed to the LCD memory
space (address 10X). The three LCD control
signals are driven from the CPLD: the RS
(Register Strobe) signal clocks data into
registers; the R/W signal determines bus
direction; and the E signal enables the bus for
read or write operations. In the standard CPLD
configuration, the R/S and R/W signals are
connected to ADDR0 and WE respectively.
The E signal can be driven directly from the
LCDEN signal available on the system
connector, or if LCDEN is left at logic ‘0’, then
E is driven whenever address “10X” is present
on the bus, CS is asserted, and AS or DS are
low. LCD bus signals and timings are shown
below.

A startup sequence with specific timings
ensures proper LCD operation. After power-on,
at least 20ms must elapse before the function-
set instruction code can be written to set the
bus width, number of lines, and character
patterns (8-bit interface, 2 lines, and 5x8 dots
are appropriate). After the function-set
instruction, at least 37us must elapse before
the display-control instruction can be written (to
turn the display on, turn the cursor on or off,
and set the cursor to blink or no blink). After
another 37us, the display-clear instruction can
be issued. After another 1.52ms, the entry-
mode instruction can set address increment (or
address decrement) mode, and display shift
mode (on or off). After this sequence, data can
be written into the DDRAM to cause
information to appear on the display.

16 x 2 character LCD

Pin 1

Powertip PC1602ARS