Parallax, Inc. • BS2p “Plus Pack” (#45184) • 10/2001
Page 5
PP_LCDDEMO2.BSP
•
Connect LCD to the BS2p Demo Board X5
•
Install jumper X6
•
Adjust contrast pot for best display
' -----[ Title ]----------------------------------------------------------------
'
' BS2p Plus Pack
'
' File...... PP_LCDDEMO2.BSP
' Purpose... Basic LCD Demo - Multi-line mode with custom characters
' Author.... Parallax, Inc.
' E-mail.... [email protected]
' Started...
' Updated... 26 SEP 2001
' {$STAMP BS2p}
' -----[ Program Description ]--------------------------------------------------
'
' This program demonstrates the use of the multi-line initialization and
' the use of custom characters. When using the standard 5x7 font, the LCD
' will hold up to eight customer characters.
'
' 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
CGRam CON $40 ' Custom character RAM
Line1 CON $80 ' DDRAM address of line 1
Line2 CON $C0 ' DDRAM address of line 2
' -----[ Variables ]--------------------------------------------- ---------------
'