27220 Parallax Inc, 27220 Datasheet - Page 95

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
' -----[ Subroutines ]-----------------------------------------------------
LCD_Cmd:
LCD_Out:
Behind the Scenes
In this program, the LCD is initialized for multi-line mode (note the additional lines
after entering 4-bit mode). This will allow both lines of the LCD module to display
information.
downloaded to the LCD.
The LCD has room for eight, user-definable customer characters. The data is stored
for these characters in an area called CGRAM and must be downloaded to the LCD
after power-up and initialization (CGRAM is volatile, so custom character definitions
are lost when power is removed from the LCD). Each custom character requires eight
bytes, the first byte being the top line of the character, the last byte being the
bottom line of the character. The eighth byte is usually $00 as this is where the
cursor is positioned when under the character.
NEXT
PAUSE 2000
GOTO Main
LOW RS
LcdBus = char.HIGHNIB
PULSOUT E, 3
LcdBus = char.LOWNIB
PULSOUT E, 3
HIGH RS
RETURN
FOR idx2 = 0 TO 4
NEXT
char = LcdLine2 + idx1
GOSUB LCD_Cmd
LOOKUP idx2, [0, 1, 2, 1, newChar], char
GOSUB LCD_Out
PAUSE 100
With the display initialized, custom character definitions are
' 5 characters in
' set new DDRAM address
' move cursor position
' get animation "frame"
' write "frame"
' animation delay
' do it all over
' enter command mode
' output high nibble
' strobe the Enable line
' output low nibble
' return to character mode
cycle

Related parts for 27220