Reset a standard LCD1602

I attached a standard LCD 16*2 to my atmega328 via breadboard and wires (~ 15 cm). 4 Data lines, RS, E, GND, 5V , added a trim pot to the Contrast pin and 5V/GND via 100 Ohms to the Backlight. R/W is connected to GND, the other 4 data pins are empty.

5V for both atmega328 and LCD come from a 5V 1.3A wallwart, showing 5.1V. 100 nF are to stabilize the atmega328 Vcc Controller runs the standard Arduino LCDLibrary 1.0.5R2

All works fine but sometimes it happens that the display shows weird patterns. "sometimes" is typically, when I touch something on the breadboard, attached to RxTx.

I know, I should first make my breadboard wiring better, mechanically stable.

But besides that, I noticed that even pushing the Arduino Reset button does not solve the situation, but I have to remove the 5V completely (from the LCD) to get it running again.

My question: Does a standard LCD Display need a power on / off, to return into a stable state or should the library resolve that ?

I added a little delay(10) in setup() before lcd.begin(16,2); but that did not help. ( I understand it might just affect the situation after power return, which is fine, anyway )

Is this normal, just beyond tutorial level? Do you usually add some reset "electronics" (an n/c button in the simplest case ?) for real projects ? Do you have the 5V supply for the LCD controlled by the Arduino software?

Any more hints ?

But besides that, I noticed that even pushing the Arduino Reset button does not solve the situation, but I have to remove the 5V completely (from the LCD) to get it running again.

This is actually a worst case scenario as far as stable LCD operation is concerned since even though the external controller (the Arduino) has been reset the LCD controller has not. Unless the external controller includes code to reset the LCD controller (there's no reset pin) operation will be unpredictable.

You can find a complete explanation by following the [u]LCD Initialization[/u] link at http://web.alfredstate.edu/weimandn

The LiquidCrystal library contains initialization code that fairly closely follows the Hitachi recommendations but there are some differences. For the most part it seems to work reliably but it seems that certain LCD modules sometimes have some problems especially when using the 4-bit interface.

I suspect that your module may be out of specification especially if you picked it up for 99 cents on ebay.

My question: Does a standard LCD Display need a power on / off, to return into a stable state or should the library resolve that ?

Yes and Yes. A 'standard LCD display' is designed to be integrated into a product where its power on / off sequence is carefully integrated into the overall operation of the device.

I have found that good program code that carefully follows all of the recommendations in the Hitachi datasheet flowcharts will work with just about any LCD module. Be aware that the sample code in that same datasheet does NOT follow those recommendations (go figure). You can find some example code (not a library) that works reliably at the above link.

You may want to try a different library that has been adapted to deal with out of spec LCD modules. It was designed to drive 40 x 4 displays but will also work with the standard 80 character displays. To get a copy start here:--> http://code.google.com/p/liquidcrystal440/ and follow the [u]Downloads[/u] link to get to the latest version.

Don

Hi Don, thanks !

Seems THE expert stumbled across my question ;)

Before trying to do an electrical power-up of the LCD on every Software-Reset, I'll try to compare the current "official" LiquidCrystal library (probably same as LiquidCrystal1.0.zip at code.google.com) with your recommendation liquidcrystal440 and the flowchart and doc on your website.

Might take a while to dig through all that, thanks for now.