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
Table5-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
00
00000011
Character BitmapDont Care
Character
Addresses
Row
Addresses
Write Data to CG RAM or DD RAM
Upper Nibble Lower Nibble
UG257_05_05_061406
———
A5 A2 A0A1 D7 D5D6 D4 D2D3D0D1A4 A3
———
001011
0
00
00
000
000111 ———
——
001111
0
00
00010011 ———
——
011011
0
00
00010111 ———
——
011111
Tabl e 5 - 3 : LCD Character Display Command Set
Function
LCD_RS
LCD_RW
Upper Nibble Lower Nibble
DB7
DB6
DB5
DB4
DB3
DB2
DB1
DB0
Clear Display 0000000001
Return Cursor Home 000000001-
Entry Mode Set 00000001I/DS
Display On/Off 0000001DCB
Cursor and Display Shift 000001S/CR/L
- -
Function Set 00001010- -