Hi there,
I'm struggling to a get a hitachi compatible LCD to work.
it initialises and now all I see are 32 black squares. I've tried adjusting the contrast but it doesn't seem to help.
The header files and background code comes from http://winavr.scienceprog.com/ex...
I've been over all the connects in the hope of finding a fault. So now I'm stuck and not sure where to look next.
The LCD is a topway LMB162ABC and the chip is a mega 324.
I've attached the entire project file if that will help. Thanks.
#define F_CPU 41943000 #include#include #include #include #include "LCD/lcd_lib.c" #include "LCD/lcd_lib.h" #define LEDGRNPIN PD5 //Green LED to Pin D 5 #define LEDREDPIN PD6 //Red LED to Pin D 6 #define LEDPORT PORTD //Set LED output port. /*--------------------------------------------------- LED Indicator Lights. Red == Fault Green == OK Red&Green == Busy ---------------------------------------------------*/ void LED(char colour) { switch(colour) { case 'O': { //flash GREENLED LEDPORT |= (1 << LEDGRNPIN); // switch on _delay_ms(200); LEDPORT &= ~(1 << LEDGRNPIN); // switch off _delay_ms(200); break; } case 'F': { //flash REDLED LEDPORT |= (1 << LEDREDPIN); // switch on _delay_ms(200); LEDPORT &= ~(1 << LEDREDPIN); // switch off _delay_ms(200); break; } default: { //flash BOTH LEDPORT |= 1 << LEDREDPIN | 1 << LEDGRNPIN; // switch on _delay_ms(200); LEDPORT &= ~(1 << LEDREDPIN )& ~(1 << LEDGRNPIN); // switch off _delay_ms(200); break; } } } int main(void) { DDRD = 0b01100111; //Set port D0,1,2,5,6 to output DDRC = 0b11111111; //Set port C to output LCDinit();//init LCD 8 bit, dual line, cursor right _delay_ms(1); LCDclr(); //clr LCD _delay_ms(1); LCDhome(); //return cursor to 0 while(1) { LED('F'); //Flash red LED LCDstring("Hello /n World", 11); //Send string to LCD; _delay_ms(100); LCDclr(); //Clr LCD } return 0; }