Hi,

I am using a PIC18F87K22 and want to write a simple message to the LCD but something is not right, perhaps the set up of Port B is not correct?, any help would be greatly appreciated, I have the following code below:


DEFINE OSC 16
Define LCD_DREG PORTB ' Define LCD connections
Define LCD_DBIT 0
Define LCD_RSREG PORTB
Define LCD_RSBIT 4
Define LCD_EREG PORTB
Define LCD_EBIT 5
DEFINE LCD_BITS 4 'LCD bus size 4 or 8
DEFINE LCD_LINES 2 'Number lines on LCD
DEFINE LCD_COMMANDUS 2000 'Command delay time in us
DEFINE LCD_DATAUS 50 'Data delay time in us

ANCON0 = 0
ANCON1 = 0
ANCON2 = 0
Pause 10 ' Wait for LCD to startup



STARTUP:


Lcdout $fe, 1,"HELLO "
Lcdout $fe,$C0,"WORLD "
PAUSE 4000

goto startup



END