You appear to be using a basic compiler, which one?
Your initialisation code is wrong, this is what I use (in C),
Code:
RW=0;
E=0; //clear enable
RS = 0; //going to write command
__delay_ms(30); //delay for LCD to initialize.
writeNibble(0x3); //Required for initialization
__delay_ms(5); //required delay
writeNibble(0x3); //Required for initialization
__delay_ms(1); //required delay
writeCommand(0x20); //set to 4 bit interface
writeCommand(0x2c); //set to 4 bit interface, 2 line and 5*10 font
writeCommand(0x01); //clear display
writeCommand(0x06); //move cursor right after write
writeCommand(0x0C); //turn on display
writeCommand(0x01); //clear display
The delay sequence is defined in the LCD datasheet.
I'm assuming that R/W is grounded.
Also, should DEFINE LCD_BITS 4 be DEFINE LCD_BITS 0 as it's using the lower nibble.
car wrap atlanta
Mike.