LCD display
tempest
Posts: 10
The task is simply to write your first name on the top line of the LCD display
does anyone know where I can find some code to this? or give me a helping start?
****· LCD display program· ******
'····· 4 line by 16 char display
'····· first initialize for 8-bit mode
·
DIRS = %0000001111111111····· ··········· ‘set pins P0-P9 as outputs
E········ con ··········· 8········· ······················· ··········· ‘set Enable pin as I/O pin P8
RS····· con··········· 9········· ······················· ··········· ‘set RS pin as I/O pin P9
·
Low RS········ ··········· ··········· ‘Place the HD44780 in instruction mode
pause 20······ ··········· ··········· ‘wait at least 15mS after power ON to initialize
·
outl = %00110000· ··········· ‘Basic code for initialization
pulsout E,1
pause 20······ ··········· ··········· ‘wait at least 4.1mS
·
pulsout E,1·· ··········· ··········· ‘Already the correct code, just repeat the pulsout
pause 20······ ··········· ··········· ‘wait at least 100uS
·
pulsout E,1
pause 20
·
outl = %00111000· ··········· ‘(0011NFxx)··········· N=number of lines: 1 = 2, 0 = 1 set = 1
pulsout E,1·· ··········· ··········· ‘F = font:1 = 5x10 pixel, 0 = 5x7 set = 0
pause 10
·
outl = %00001000· ··········· ‘(display off)
pulsout E,1
pause 10
·
outl = %00000001· ··········· ‘(clear display and set DD ram to address 0)
pulsout E,1
pause 10
·
outl = %00000110· ··········· ‘(000001I/D S) I/D = increment (1) or decrement(0)
pulsout E,1·· ······················· ‘cursor or display on entry,· set = 1
pause 10······ ······················· ‘S = shift entire display (1) or not (0) set = 0
·
outl = %00001111· ··········· ‘(000011CB)· C = Full cursor (1) or underline (0)
pulsout E,1·· ··········· ··········· ‘B = cursor blinking (1) or not (0)
pause 10
·
' Initialization done
·
stop
thats what I got so far to make the cursor blink ..but where do I find code to display my name on it?
does anyone know where I can find some code to this? or give me a helping start?
****· LCD display program· ******
'····· 4 line by 16 char display
'····· first initialize for 8-bit mode
·
DIRS = %0000001111111111····· ··········· ‘set pins P0-P9 as outputs
E········ con ··········· 8········· ······················· ··········· ‘set Enable pin as I/O pin P8
RS····· con··········· 9········· ······················· ··········· ‘set RS pin as I/O pin P9
·
Low RS········ ··········· ··········· ‘Place the HD44780 in instruction mode
pause 20······ ··········· ··········· ‘wait at least 15mS after power ON to initialize
·
outl = %00110000· ··········· ‘Basic code for initialization
pulsout E,1
pause 20······ ··········· ··········· ‘wait at least 4.1mS
·
pulsout E,1·· ··········· ··········· ‘Already the correct code, just repeat the pulsout
pause 20······ ··········· ··········· ‘wait at least 100uS
·
pulsout E,1
pause 20
·
outl = %00111000· ··········· ‘(0011NFxx)··········· N=number of lines: 1 = 2, 0 = 1 set = 1
pulsout E,1·· ··········· ··········· ‘F = font:1 = 5x10 pixel, 0 = 5x7 set = 0
pause 10
·
outl = %00001000· ··········· ‘(display off)
pulsout E,1
pause 10
·
outl = %00000001· ··········· ‘(clear display and set DD ram to address 0)
pulsout E,1
pause 10
·
outl = %00000110· ··········· ‘(000001I/D S) I/D = increment (1) or decrement(0)
pulsout E,1·· ······················· ‘cursor or display on entry,· set = 1
pause 10······ ······················· ‘S = shift entire display (1) or not (0) set = 0
·
outl = %00001111· ··········· ‘(000011CB)· C = Full cursor (1) or underline (0)
pulsout E,1·· ··········· ··········· ‘B = cursor blinking (1) or not (0)
pause 10
·
' Initialization done
·
stop
thats what I got so far to make the cursor blink ..but where do I find code to display my name on it?
Comments
You can find code in StampWorks, and in our LCD AppMod documentation.
BTW ... your excessive PAUSE values are simply wasting time.·· Better to match the spec (or get as close as you can) before making big changes.· Most instructions that don't require a specific pause time (as in the beginning of the sequence) require about a 40 microsecond delay.· Since the BASIC Stamp takes longer than this to load an instruction, you don't need the delays toward the end of your sequence.· Exceptions are clear and home instructions, which need a millisecond or two to finish.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Post Edited (Jon Williams) : 12/21/2004 7:38:18 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office