16f88 can't get lcd to work
Hi all,
I've got a problem trying to display a simple message on an LCD using a PIC16F88. The problem, after much testing, seems to be the PAUSE command. It appears that the delay produced, even though in the code its 5sec, is much much much to small. So small infact that I think the LCD has little time initialise. The resulting text is very random both top and bottom lines.
DEFINE OSC 4 ' XT osc
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 3
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 2
DEFINE LCD_BITS 4
' Set number of lines on LCD
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
' Set data delay time in us
DEFINE LCD_DATAUS 100
ANSEL=0
CMCON=7
GOSUB DELAY
Lcdout $fe, 1, "Hello" ' Display Hello
GOSUB DELAY
LCDOUT $FE,1,"John"
END
DELAY:PAUSE 5000
RETURN
I've tried everything including re-installing PBP/MCS. I've also compiled this code on a different machine;BUT, the LCD displays to quickly.
To confirm all is OK I compiled this code for the 16f628, all was fine, there was indeed a 5 sec delay. Back to the 16f88, tried another fresh chip, same as before. Can't be the chip..
I'm using PBP 2.47, MPLAB V7.31.
Help most appreciated.
John