it seems like people might be trying to use this as a reference so im gonna post the custom sub i made to compensate for my pins not being in the right order. you can put any port\pin in place of the ones i have
for more info see:
http://www.geocities.com/SiliconVall...d/commands.htm
----- lcd type and setup.
4 bit mode
left to right
no cursor no blink
2 line
8 character
------
lcde var PORTC.1 '<---- LCD Enable
lcdrs var PORTC.0'<---- LCD R/S
lcd7 var PORTA.0 '<---- LCD DATA 7
lcd6 var PORTA.1 '<---- LCD DATA 6
lcd5 var PORTA.2 '<---- LCD DATA 5
lcd4 var PORTB.3 '<---- LCD DATA 4 *notice this is one portB*
B1 var byte '<---- HOLDS LCD CHARACTER ASCII DATA BYTES
LCD3: 'lcd subroutine
lcdrS = 1 'ascii mode
FOR X = 0 TO 7 ' Count from 0 to 7 (8 character per line on lcd)
LOOKUP X,["EYE DLY "],B1 ' Get character number B0 from string to variable B1
lcd7 = B1.7 'puts top half of ascii data on pins 7-4
lcd6 = B1.6
lcd5 = B1.5
lcd4 = B1.4
gosub lcdtog 'toggle the e line
lcd7 = B1.3 'puts bottom half of ascii data on pins 7-4
lcd6 = B1.2
lcd5 = B1.1
lcd4 = B1.0
gosub lcdtog 'toggle the e line
NEXT X ' Do next character
Return
lcdtog:
pause 1
High Lcde 'set lcd enable line high
pause 1
Low Lcde 'set lcd enable line low
pause 1
Return
lcdinit:
'-----------------------
Pause 35 'wait at least 35ms
lcdrS = 0 'instruction mode
pause 50
lcd7 = 0
lcd6 = 0
lcd5 = 1
lcd4 = 0 'initialize the lcd
gosub lcdtog 'Toggle E line
'---------------------------
FOR X = 0 TO 4 ' Count from 0 to 4 (5 commands to be sent)
LOOKUP X,[$28,$0C,$0C,$06,$01],B1 ' Get character number B0 from string to variable B1
lcd7 = B1.7
lcd6 = B1.6
lcd5 = B1.5
lcd4 = B1.4
gosub lcdtog
lcd7 = B1.3
lcd6 = B1.2
lcd5 = B1.1
lcd4 = B1.0
gosub lcdtog
pause 30
NEXT X ' Do next character
'----------------------------
Return
Bookmarks