Hi all,

I have a couple of projects with 16F877a's and 4 line LCD panels working fine.

I wanted to do something smaller scale, and have a 16F84a and a 2x16 LCD. I have used this LCD in the past and it was fine. I have written a very short program just to get the LCD going, but alas it doesn't show anything... Below is my code:

Code:
define osc 4

' Define LCD registers and bits
DEFINE  LCD_DREG        PORTB            
DEFINE  LCD_DBIT        4                    
DEFINE  LCD_RSREG       PORTB            
DEFINE  LCD_RSBIT       2                
DEFINE  LCD_EREG        PORTB            
DEFINE  LCD_EBIT        3

TRISA = %11111

butup           var porta.0
butdn           var porta.1
light             var portb.1

light = 0

pause 1000
light = 1


lcdout $fe,1

Start:

lcdout $fe,$80,"line one"
lcdout $fe,$C0,"line two"

pause 500
toggle light

goto Start
On turn-on, the LCD enables (1st row black boxes, 2nd row blank) then waits the 1000 and clears the LCD. After that, I get nothing at all on the LCD, but the led blinks away happily.

I've done this before on a 16F88 I think (albeit a while ago) which is why it is frustrating me so.

Can anyone point out anything I've done wrong in the code? Do I need to declare anything else, etc? I have checked and rechecked the wiring many times, if no-one can point out anything I will have to source and test another LCD incase that is the problem.

Thanks in advance.

Dave