BASIC stamp manual v2.2
LCDOUT – BASIC Stamp Command Reference
Page 266 • BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com
LCDOUT 0, 13, ["Yo!"]
Most of the time, you will want to send data without preceding it with a
command. To do this, simply use 0 for the Command argument, as in:
LCDOUT 0, 0, ["Hello there!"]
Another use for the LCDOUT command is to access and create custom
characters. The Hitachi 44780 controller has a built-in character set that is
similar to the ASCII character set (at least for the first 128 characters).
Most of these characters are stored in ROM and are not changeable,
however, the first eight characters (ASCII 0 though 7) are programmable.
Each of the programmable characters is five pixels wide and eight pixels
tall. It takes eight bytes to describe each character; one byte per row (the
left-most three bits are ignored). For example, the character at ASCII
location 0 is defined by the bit patterns stored in bytes 0 through 7 of
Character Generator RAM (CGRAM). The character at ASCII location 1 is
defined by the bit patterns stored in bytes 8 through 15 of CGRAM, and so
on.
To create a custom character, use some graph paper to plot out the bit
pattern (on and off pixels) in a 5 x 8 pattern, as shown in Figure 5.16. Then
calculate the corresponding binary value of the bit pattern for each of the
eight rows of character data.
43210
Byte 0:
Character Cell Structure and Data
Byte 1:
Byte 2:
Byte 3:
Byte 4:
Byte 5:
Byte 6:
Byte 7:
---------Bits---------
xxx00000
xxx01010
xxx00000
xxx00100
xxx10001
xxx01110
xxx00000
xxx00000
Binary Values
00
10
00
04
17
14
00
00
Decimal Values
Figure 5.16: LCD Character
Structure.
After the data is calculated for each character (8 byte values per character),
use the LCDOUT command with the "Move To CGRAM Address"
instruction to insert the data into the character's CGRAM locations. For
example, the code below will store the character shown in Figure 5.16 into
CREATING CUSTOM CHARACTERS.