I have tried the pseucode in the datasheet. I go home and try yours again. Somehow my LCD operation is much more consistent when I prolong the delay...... Yet the reset part is still problematic at times. Thanks, john --- "M. Adam Davis" wrote: > What is your LCD init routine? I've never > experienced that problem > with the cheap LCDs I have used with this routine: > > write4 just writes 4 bits to the LCD interface, > write8 writes 8 bits > in two cycles of 4 bits. The rest should be pretty > explanatory, > except for the ??? which I sure could be determined > from the data > sheet in short order. > > void initlcd(void) > { > delayms(20); // Wait for LCD to power up ( >15ms ) > RS=0; // Set RS low for instruction > write4(3); // Set interface to 8 bits > delayms(5); // Wait for LCD execute instruction ( > >4.1ms ) > write4(3); // Set interface to 8 bits > delayms(1); // Wait for LCD execute instruction ( > >100us ) > write4(3); // Set interface to 8 bits > delayms(5); // Wait for LCD execute instruction > (At this point > // we could actually start using the busy flag) > write4(2); // Set the display to 4 bit interface > delayms(5); // Wait for LCD execute instruction > write8(0x28); // Set the display to two line and > ??? > delayms(5); // Wait for LCD execute instruction > write8(6); // ??? > delayms(5); // Wait for LCD execute instruction > write8(1); // Clear the LCD > delayms(5); // Wait for LCD execute instruction > write8(0xf); // ??? > delayms(5); // Wait for LCD execute instruction > return; > } > > -Adam > > On 4/3/06, kravnus wolf wrote: > > I have written code for the LCD from bgmicro > > > > > http://www.bgmicro.com/prodinfo.asp?sid=0968912037037037604814310&prodid=LCD1022&page=1&cri=lcd&stype=3 > > > > I managed to get it started and printing > characters on > > it. What grips me is that if I reset the PIC > through > > MCLR quickly and numerous times the LCD just > prints > > blank! It seems that the LCD cannot handle quick > > restart over and over again. I am left > > clueless........ > > > > Thanks, > > John > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > -- > > http://www.piclist.com PIC/SX FAQ & list archive > > View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist