Command set, Figure 5-5 – Digilent 410-087P-KIT User Manual

Page 46

Advertising
background image

46

www.xilinx.com

Spartan-3E Starter Kit Board User Guide

UG230 (v1.0) March 9, 2006

Chapter 5: Character LCD Screen

R

The CG RAM address counter can either remain constant after read or write operations, or
auto-increments or auto-decrements by one location, as defined by the I/D set by the

Entry

Mode Set

command.

Figure 5-5

provides an example, creating a special checkerboard character. The custom

character is stored in the fourth CG RAM character location, which is displayed when a
DD RAM location is 0x03. To write the custom character, the CG RAM address is first
initialized using the

Set CG RAM Address

command. The upper three address bits point to

the custom character location. The lower three address bits point to the row address for the
character bitmap. The

Write Data to CG RAM or DD RAM

command is used to write each

character bitmap row. A ‘1’ lights a bit on the display. A ‘0’ leaves the bit unlit. Only the
lower five data bits are used; the upper three data bits are don’t care positions. The eighth
row of bitmap data is usually left as all zeros to accommodate the cursor.

Command Set

Table 5-3

summarizes the available LCD controller commands and bit definitions. Because

the display is set up for 4-bit operation, each 8-bit command is sent as two 4-bit nibbles.
The upper nibble is transferred first, followed by the lower nibble.

Upper Nibble

Lower Nibble

Write Data to CG RAM or DD RAM

A5

A4

A3

A2

A1

A0

D7

D6

D5

D4

D3

D2

D1

D0

Character Address

Row Address

Don’t Care

Character Bitmap

0

1

1

0

0

0

-

-

-

0

1

0

1

0

0

1

1

0

0

1

-

-

-

1

0

1

0

1

0

1

1

0

1

0

-

-

-

0

1

0

1

0

0

1

1

0

1

1

-

-

-

1

0

1

0

1

0

1

1

1

0

0

-

-

-

0

1

0

1

0

0

1

1

1

0

1

-

-

-

1

0

1

0

1

0

1

1

1

1

0

-

-

-

0

1

0

1

0

0

1

1

1

1

1

-

-

-

0

0

0

0

0

Figure 5-5:

Example Custom Checkerboard Character with Character Code 0x03

Table 5-3:

LCD Character Display Command Set

Function

LC

D_RS

LCD_R

W

Upper Nibble

Lower Nibble

DB7

DB6

DB5

DB4

DB3

DB2

DB1

DB0

Clear Display

0

0

0

0

0

0

0

0

0

1

Return Cursor Home

0

0

0

0

0

0

0

0

1

-

Entry Mode Set

0

0

0

0

0

0

0

1

I/D

S

Display On/Off

0

0

0

0

0

0

1

D

C

B

Cursor and Display Shift

0

0

0

0

0

1

S/C

R/L

-

-

Advertising