Parallax BASIC Stamp 2e Programming Manual page 166

Table of Contents

Advertisement

LCDCMD - BASIC Stamp Command Reference
The number 128 tells the LCD we wish to move the cursor and 66 is the
location number of the desired position.
(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 to the right of the 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 1, 24)
to slowly scroll the text onto the display from right to left. If you did so,
the DRAM positions that were on the left of the screen would now be past
the left edge of the screen. For example,
LCDCMD 1, 24
LCDCMD 1, 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 DRAM location 2
and the lower-left character would be DRAM 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 DRAM 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.
command will not be used, LCD pin 5 (R/W pin) can be connected to
ground and I/O pin 2 (shown above) may be left disconnected. I/O pin 2
will still be set to output mode for each LCDCMD and LCDOUT
command executed, however.
Page 164 • BASIC Stamp Programming Manual 2.0b • www.parallaxinc.com
Similarly, sending just 128
If the LCDIN
S
.
CROLLING THE DISPLAY
N
DRAM
OTES ON
MAPPING FOR
4
20 LCD
.
X
S
D
LCD
.
ETAILS ON
WIRING

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?

Table of Contents