Tom,
according to the datasheet the LCD has en embedded HD44780 (or compatible) controller.
with this controller you don't need to "manually" initialize the LCD.
The first LCDOUT command issued does all the initialisation for you.
assuming you have a 4k7 pull-up on RA4
the following should work on an 16F876(A)
Code:
DEFINE OSC 20 ' <-- set your clock speed here !
ADCON1=7 ' All Digital
DEFINE LCD_DREG PORTA ' Set data pin of LCD to
DEFINE LCD_DBIT 0 ' PORTA.0-PORTA.3
DEFINE LCD_RSREG PORTA ' Set RS bit of LCD to
DEFINE LCD_RSBIT 5 ' PORTA.5
DEFINE LCD_EREG PORTA ' Set E bit of LCD to
DEFINE LCD_EBIT 4 ' PORTA.4
DEFINE LCD_LINES 4 ' 4 Lines LCD
PAUSE 1000 ' wait for LCD controller to start up
Loop:
LCDOUT $FE,1 ' clear display and move cursor home
PAUSE 500 ' wait for "CLEAR" command to complete
LCDOUT "HELLO WORLD" ' print "HELLO WORLD" at current cursor position
PAUSE 1000
GOTO LOOP
END
If there is still no success there is most likely something wrong with your LCD and/or your PIC.
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Bookmarks