Thank you very much for helping me this far, Most people on the boards lose patience and just leave me hanging.
but to answer your question, yes, i always power off then power on again before initialization. the only way i initialize is in the beginning of my program, and after I see it doesnt work, i cut the power, wait a few seconds and then power it up again.
I've tried a new LCD_init function, and modeled it exactly like what is mentioned in the HD44780 datasheet, and i still get the same result. 0x30, good to go, but 0x38,0x34, and 0x3C, are rejected and do not initialize the LCD.
wierd huh?
anyways here's the new LCD_init function for comparison:
Code:
void LCD_init(void)
{// wait for power on
char data = 0;
DelayMs(40);
RSclear();
RWclear();
DelayUs(1);
Eset();
data=0x30;
portd_set(data); // 1st function set
// LCD_Strobe();
DelayUs(2);
Eclear();
DelayMs(5);
portd_clear();
Eset();
data=0x30;
portd_set(data); // 2nd function set
DelayUs(2);
Eclear();
// LCD_Strobe();
DelayUs(250);
portd_clear();
Eset();
data=0x30;
portd_set(data); // 3rd function set
DelayUs(2);
Eclear();
// LCD_Strobe();
DelayUs(50);
portd_clear();
Eset();
data=0x30;
portd_set(data); // 4th and final function set
DelayUs(2);
Eclear();
// LCD_Strobe();
DelayUs(50);
portd_clear();
Eset();
data = 0x08;
portd_set(data); // turn off LCD
DelayUs(2);
Eclear();
// LCD_Strobe();
DelayUs(50);
portd_clear();
Eset();
data = 0x01;
portd_set(data); // LCD clearscreen
DelayUs(2);
Eclear();
// LCD_Strobe();
DelayMs(2);
portd_clear();
Eset();
data=0x06; // entry mode set
portd_set(data);
DelayUs(2);
Eclear();
// LCD_Strobe();
DelayUs(50);
portd_clear();
Eset();
data=0x0F; // Turn on LCD w/ cursor and blinking
portd_set(data);
DelayUs(2);
Eclear();
// LCD_Strobe();
DelayUs(50);
portd_clear();
LCD_cursorreset(); // sends command 0x02
}
once again, thank you