dtokez:
I just tried the last suggestion, replacing some of the bits but could not get that too complie
What compile errors are you getting, and on what lines? If you post your sketch, I can try making the changes and see what problems there are compiling it.
PS - an alternative that might work even better would be to add a pulldown resistor between the EN input to the LCD and ground. What I'm trying to do is to make sure the LCD doesn't think it's receiving any commands while it powers up.
dtokez:
1- Indeed, that is the behaviour that I'm currently dealing with.
Very strange. The Arduino reset line does not go to the LCD, therefore what's resetting the LCD after you press reset must be the begin() call in the LCD constructor and/or the begin() call in setup(). So the question is, what else are you doing in your sketch that is making those calls work?
I'm running out of ideas, but maybe it is some other command you sent the LCD before you pressed reset, like printing characters or setting the cursor location. So all I can suggest now is that in between making those 2 begin calls in setup, you try try doing those things.
Following on from my previous reply, does it work if you repeat all the code in setup() again? i.e. do the whole block twice over.
btw I see that the AdaFruit tutorial says to connect the backlight directly between Vcc and gnd, but I think on some lcds such as the one I have, you need a series resistor for the backlight.
Send the initialisation sequence yourself in setup(). See page 12 of the datasheet at http://www.egochina.net.cn/eBay/Download/SPLC780D.pdf for the sequence for 4-bit interface. For each item in the sequence, you need to wait for any delay time that is indicated, set the pins to the specified values, then pulse the EN pin high and then low again. If no delay time is indicated, you still need a delay between commands, but I can't find anything in the data sheet that says how long.
Try with the RW pin also connected to the Arduino, using the LiquidCrystal constructor that takes 7 pin numbers. That way, the LCD library will wait for the busy flag to clear before sending new instructions to the LCD.
Take a copy of the LiquidCrystal .cpp file and include it in your sketch, but double all the delays.
Try with the RW pin also connected to the Arduino, using the LiquidCrystal constructor that takes 7 pin numbers. That way, the LCD library will wait for the busy flag to clear before sending new instructions to the LCD.
If you are talking about the LiquidCrystal library that is suppiled with the Arduino IDE that won't help at all. All the LiquidCrystal library does with the R/W pin is drive it low and keep it there. What you would be accomplishing is just unnecessarily tying up a extra Arduino I/O pin.
On the other hand the LiquidCrystal440 library will indeed use the busy flag as described but that won't help you either since you can't use the busy flag during the early part of the initialization where the LCD controller reset is being accomplished. The improved time delays in the library will likely take care of your problem.