English
Language : 

805-00012 Datasheet, PDF (4/11 Pages) List of Unclassifed Manufacturers – Parallax Serial LCD
{{
Serial_LCD_Demo.spin
For Parallax Serial LCDs 27976, 27977, 27979
}}
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
TX_PIN = 0
BAUD = 19_200
OBJ
LCD : "FullDuplexSerial.spin"
PUB Main
LCD.start(TX_PIN, TX_PIN, %1000, 19_200)
waitcnt(clkfreq / 100 + cnt)
' Pause for FullDuplexSerial.spin to initialize
LCD.str(string("Hello, this text will wrap."))
Moving the Cursor
When you send a character to the Serial LCD, it always displays at the current cursor position. There are
a few different ways to move the cursor on the Serial LCD display. After each character you send, the
cursor automatically moves over one position. Along with this, there is a standard set of cursor move
commands including Backspace, Carriage Return, and Line Feed.
The Backspace/Left command (Dec 8) moves the cursor one place to the left and the Right command
(Dec 9) moves the cursor one place to the right. These can be useful for moving the cursor around to
overwrite existing text. These commands wrap to the next line of the display, if necessary. The Line Feed
command (Dec 10) moves the cursor to the next line of the display without changing the horizontal
position of the cursor. The Carriage Return command (Dec 13) also moves the cursor to the next line, but
it moves the cursor to the leftmost position on that line as well. The Form Feed command (Dec 12) clears
the entire display and moves the cursor to the leftmost position on line 0, just like when you first turn on
the display. You will need to pause for 5mS in your code after sending the Form Feed command, to give
the Serial LCD time to clear the display. Except for Form Feed, none of these move commands affects the
characters on the display.
There are also direct move commands that you can use to move the cursor to any position on the display
with a single command. The commands in the range Dec 128 to 143 and Dec 148 to 163 move the cursor
to the 16 different positions on each of the two lines of the model 27976 and 27977 LCDs. The
commands in the range Dec 128 to 207 move the cursor to the 20 different positions on each of the four
lines of the model 27979 LCD.
Controlling the Display
You also have control over the various display modes of the Serial LCD. The display-off command (Dec
21) turns off the display so that all of the characters disappear. The characters aren’t erased from the
display, though, and you can even keep writing new characters to the display when it is turned off. A
trick to make a lot of text show up all at once, even at a slow baud rate, is to turn off the display and
then send all of your text. Then, when you turn the display on again, all of the text appears instantly.
Copyright © Parallax Inc.
Parallax Serial LCDs (#27976, 27977, 27979)
v3.1 3/11/2013 Page 4 of 11