Parallax, Inc. • BS2p “Plus Pack” (#45184) • 10/2001
Page 8
PP_LCDFONT.BSP
•
Connect LCD to the BS2p Demo Board X5
•
Install jumper X6
•
Adjust contrast pot for best display
' -----[ Title ]----------------------------------------------------------------
'
' BS2p Plus Pack
'
' File...... PP_LCDCFONT.BSP
' Purpose... Advanced LCD Demo - custom numeric font(s)
' Author.... Parallax, Inc.
' E-mail.... [email protected]
' Started...
' Updated... 26 SEP 2001
' {$STAMP BS2p}
' -----[ Program Description ]--------------------------------------------------
'
' This program demonstrates character definition replacement in order to create
' a custom font for numbers. This program creates three custom characters that
' are used to display the tens, ones and tenths value of a counter.
'
' The program analyzes the counter and updates the screen by downloading the
' appropriate character map for each digit.
'
' 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
CLines CON 8 ' lines per character
Space CON 10