i think i got the data sturcture of the lcd all figured out and i have made my own routins to control the lcd. my last problem, i hope, is that i didnt realize my lcd is 5x8 pixel not 5x7. soooo.... i need to figure out how to initialize the lcd to 5x8 character size? my lcd wont auto init so i have a sub that does it. but the link below doesnt say how init for a 5x8 character.
dwayne i havent used external memory before but i think it shouldnt be too hard. i know that i will most likely have to and i actually want to, i think
yes please let me check that code out that ur buds working on sometime, sounds like ti could be very useful.
just to update i have a tempory solotuon to my problem and i suggest this method if your hardware isnt designed well. meaning the d4-d7 data lines on the lcd are connected to random port pins.
as im sure it says above somewhere, i am using 4 bit mode to control my hd44780 compatible LCD. it is a 2 line 8 character diplay with each characters resolutin at 5x8. my data pins are as follows:
D7 = PORTA.0
D6 = PORTA.1
D5 = PORTA.2
D4 = PORTB.3 (YES PORTB)
RS = PORTC.0
E = PORTC.1
I should note just for clarity that the hd44780 lcd works on a byte by byte basis. meaning that you send it one byte at a time parallely(is that a word), in parallel. But if you are in 4 bit mode, which is recommended becuase you can free up 4 I/O lines, you need to send the same byte size command in 2 steps. firts send the upper half of the byte, clock the lcd, then send the second half, clock the lcd. then it will have recived 1 full command.
in 8 bit mode i can send %01000001 to pins D0-D7 repectivly. clock E and that is 1 byte so the lcd will update.
in 4 bit mode i would:
send %0100 to pins D4-D7 respectivly (upper half)
clock E
send %0001 to pins D4-D7 respectivly (lower half)
clock E
and it should update.
so basically just till i get creative with some formulas, im going to stick with the "brute force" method. which is as follow:
'i want to send an A to the lcd
lcd7 VAR PORTA.0 'DEClirations MAKES addressing the pins easier.
lcd6 VAR PORTA.1
lcd5 VAR PORTA.2 'the variabls should be self expl.
lcd4 VAR PORTB.3
lcdrs VAR PORTC.0
lcde VAR PORTC.1
'-------------------------------
GOSUB lcdinit
lcdrs = 1 'data mode
pause 10
lcd4=0
lcd5=1
lcd6=0 'upper half %0100
lcd7=0
GOSUB lcdtog
lcd4=0
lcd5=0 'lower half %0001
lcd6=0
lcd7=1
GOSUB lcdtog
END
lcdtog:
pause 5 ' added pauses to make sure i get the rise i need, i know its too slow
lcde = 1
pause 5 'set lcd enable line high
lcde = 0 'set lcd enable line low
pause 5
Return
lcdinit:
'the lcd needs to be initialized once, usually early in your program. there a lots of different hardware set ups so youll need to figure thisout. goto:
http://www.geocities.com/SiliconVall.../lcd/intro.htm
read the intro section.
then the command section.
then get yourself an ascii table.
and try to use the lcd simulator ( really cool!)





Bookmarks