Parallax, Inc. • BS2p “Plus Pack” (#45184) • 10/2001
Page 2
PP_LCDDEMO1.BSP
•
Connect LCD to the BS2p Demo Board X5
•
Install jumper X6
•
Adjust contrast pot for best display
' -----[ Title ]----------------------------------------------------------------
'
' BS2p Plus Pack
'
' File...... PP_LCDDEMO1.BSP
' Purpose... Basic LCD Demo - Single Line Mode
' Author.... Parallax, Inc.
' E-mail.... [email protected]
' Started...
' Updated... 26 SEP 2001
' {$STAMP BS2p}
' -----[ Program Description ]--------------------------------------------------
'
' This program demonstrates LCD basics using the BS2p.
'
' To run this program on the BS2p Demo Board, connect the LCD and install
' Jumper X6. Adjust contrast pot for best display.
'
' Refer to the Hitachi HD44780 documentation for details on LCD control.
' -----[ Revision History ]-----------------------------------------------------
'
' -----[ I/O Definitions ] ------------------------------------------------------
'
LCDpin CON 0 ' connect LCD to OutL
' -----[ Constants ]------------------------------------------------------------
'
NoCmd CON $00 ' No command in LCDOUT
ClrLCD CON $01 ' clear the LCD
CrsrHm CON $02 ' move cursor to home position
CrsrLf CON $10 ' move cursor left
CrsrRt CON $14 ' move cursor right
DispLf CON $18 ' shift displayed chars left
DispRt CON $1C ' shift displayed chars right
DDRam CON $80 ' Display Data RAM control
DispCtrl CON %00001000 ' display control command
On CON 1
Off CON 0
' -----[ Variables ]------------------------------------------------------------
'
cmd VAR Byte ' command sent to LCD