27220 Parallax Inc, 27220 Datasheet - Page 90

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
Page 80 · StampWorks
Note that this program initializes the LCD for just one line, even though two lines are
physically available on the LCD. See the following experiment for initializing the LCD
for multi-line mode.
With the use of four data bits on the LCD bus, two write cycles are necessary to send
a byte to the LCD. The BASIC Stamp’s HIGHNIB and LOWNIB variable modifiers
make this process exceedingly easy. Each nibble is latched into the LCD by pulsing
the E (enable) line high with PULSOUT.
The main portion of the program starts by clearing the LCD and displaying a
message that has been stored in a DATA statement. This technique of storing
messages in EEPROM is very useful and makes programs easier to update. In this
program, characters are written until a zero is encountered. This method lets us
change the length of the string without worrying about loop control settings. With
the message displayed, the cursor position is returned home (first position of first
line) and turned on (an underline cursor appears).
The cursor is sent back and forth across the LCD using two distinct techniques. The
first uses the cursor-right command. Moving the cursor left is accomplished by
manually positioning the cursor to a specific column position. Manual cursor
positioning is required by many LCD programs for tidy formatting of the information
in the display.
With the cursor back home, it is turned off and the blink attribute is enabled. Blink
causes the current cursor position to alternate between the character and a solid
black box. This can be useful as an attention getter. Another attention-getting
technique is to flash the entire display. This is accomplished by toggling the display
enable bit. The Exclusive OR operator (^) simplifies bit toggling, as any bit XORed
with a 1 will invert:
1 ^ 1 = 0
0 ^ 1 = 1
Using the display shift commands, the entire display is shifted off-screen to the right,
then back. What this demonstrates is that the visible display is actually a window
into the LCD’s display memory (called the DDRAM). One method of using the
additional memory is to write messages off-screen and shift the visible display to
them.

Related parts for 27220