I have 16x4 HD44780 base LCD module.
2 days ago I wrote the code and it worked but I wasn't pleased with it so i deleted it and started writing new one. And for the lase 2 days it won't work :((( I lost 5-6 hours already on this. I can't even get LCD to initialize and turn cursor and blinking ON.
Can you people find something wrong in this init code? MCU is LPC22129 with ARM7 running at 60MHz
void LCDInit(void) { IODIR0=0x7F00; IOCLR0=0x7F00; IOSET0=0x0200; LCDtoggle(); IOCLR0=0x7F00; IOSET0=0x0800; LCDtoggle(); IOCLR0=0x7F00; LCDtoggle(); IOSET0=0x0F00; LCDtoggle(); }
void LCDtoggle(void) { IOSET0=ENABLE; delayus(1); //wait for 1 microsec IOCLR0=ENABLE; }