beautypg.com

Command set, Figure 5-5 – Xilinx MIcroblaze Development Spartan-3E 1600E User Manual

Page 48

background image

46

MicroBlaze Development Kit Spartan-3E 1600 Edition User Guide

www.xilinx.com

UG257 (v1.1) December 5, 2007

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.

Figure 5-5:

Example Custom Checkerboard Character with Character Code 0x03

0

0

0

0

0

0

0

0

0

1

1

Character Bitmap

Don’t Care

Character

Addresses

Row

Addresses

Write Data to CG RAM or DD RAM

Upper Nibble

Lower Nibble

UG257_05_05_061406

A5

A2

A0

A1

D7

D5

D6

D4

D2

D3

D0

D1

A4

A3

0

0

1

0

1

1

0

0

0

0

0

0

0

0

0

0

0

1

1

1

0

0

1

1

1

1

0

0

0

0

0

0

1

0

0

1

1

0

1

1

0

1

1

0

0

0

0

0

0

1

0

1

1

1

0

1

1

1

1

1

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

-

-

Function Set

0

0

0

0

1

0

1

0

-

-