© MCS Electronics, 1995-2007
$sim
'REMOVE the above command for the real program !! '$sim is used for faster simulation
'note : tested in PIN mode with 4-bit
'Config Lcdpin = Pin , Db4 = Portb.1 , Db5 = Portb.2 , Db6 = Portb.3 , Db7 = Portb.4 , E = Portb.5 , Rs = Portb.6
Config Lcdpin = Pin , Db4 = Porta.4 , Db5 = Porta.5 , Db6 = Porta.6 , Db7 = Porta.7 , E = Portc.7 , Rs = Portc.6
'These settings are for the STK200 in PIN mode
'Connect only DB4 to DB7 of the LCD to the LCD connector of the STK D4-D7 'Connect the E-line of the LCD to A15 (PORTC.7) and NOT to the E line of the LCD connector
'Connect the RS, V0, GND and =5V of the LCD to the STK LCD connector
Rem with the config lcdpin statement you can override the compiler settings
Dim A As Byte
Config Lcd = 16 * 2 'configure lcd screen
'other options are 16 * 4 and 20 * 4, 20 * 2 , 16 * 1a 'When you dont include this option 16 * 2 is assumed
'16 * 1a is intended for 16 character displays with split addresses over 2 lines
'$LCD = address will turn LCD into 8-bit databus mode |
|
' |
use this with uP with external RAM and/or ROM |
|
' |
because it aint need the port pins ! |
|
Cls |
|
'clear the LCD |
display |
|
'display this at |
Lcd "Hello world." |
the top line |
|
Wait 1 |
|
'select the lower |
Lowerline |
line |
|
|
Wait 1 |
|
'display this at |
Lcd "Shift this." |
the lower line |
|
Wait 1 |
|
|
For A = 1 To 10 |
'shift the text to |
Shiftlcd Right |
the right |
'wait a moment |
Wait 1 |
Next |
|
|
For A = 1 To 10 |
'shift the text to |
Shiftlcd Left |
the left |
'wait a moment |
Wait 1 |
Next |
|
|
Locate 2 , 1 |
'set cursor |
position |
'display this |
Lcd "*" |
|
Wait 1 |
|
'wait a moment |
Shiftcursor Right |
'shift the cursor |
Lcd "@" |
|
'display this |
Wait 1 |
|
'wait a moment |