BASIC stamp manual v2.2

LCDCMD – BASIC Stamp Command Reference
Page 254 BASIC Stamp Syntax and Reference Manual 2.2 www.parallax.com
On a standard 2 x 16 character display, the following command would
move the cursor to the third column of the second line:
LCDCMD 0, 128 + 66
The number 128 tells the LCD we wish to move the cursor and 66 is the
location number of the desired position. Similarly, sending just 128
(128 + 0) would move the cursor to the first character of the first line (the
upper left character if the display is at the home position).
You may have noticed that the 2 x 16 display has many locations that are
not visible; they are beyond the right edge of the screen. These locations
(16 – 39 and 80 to 103) become important for scrolling operations. For
example, it is possible to move the cursor to location 16, print some text
there and then issue a number of Scroll Left instructions (LCDCMD 0, 24)
to slowly scroll the text onto the display from right to left. If you did so,
the DDRAM positions that were on the left of the screen would now be
past the left edge of the screen. For example,
LCDCMD 0, 24
LCDCMD 0, 24
would cause the screen to scroll to the left by two characters. At this point,
the upper-left character in the display would actually be DDRAM location
2 and the lower-left character would be DDRAM location 66. Locations 0,
1, 64 and 65 would be off the left edge of the LCD and would no longer be
visible. Some interesting effects can be achieved by taking advantage of
this feature.
The 4 x 20 LCD has a strange DDRAM map. The upper-right character is
location 19 and the next location, 20, appears as the first character of the
third line. This strange mapping is due to constraints in the LCD
controller and the manufacturers design, and unfortunately makes the
scrolling features virtually useless on the 4 x 20 displays.
Even though the LCD requires many pins to talk to it, only the Enable pin
needs to remain dedicated to the LCD and all the other pins can be
multiplexed (shared) with certain other devices (if wired carefully). In
addition, the I/O pin connected to the LCD's R/W pin is only necessary if
the LCDIN command will be used in the application. If the LCDIN
command will not be used, LCD pin 5 (R/W pin) can be connected to
SCROLLING THE DISPLAY.
N
OTES ON DDRAM MAPPING FOR 4 X 20
LC
D
S.
DETAILS ON LCD WIRING.