LCD displays white boxes after disconnect/reconnec

Hello! I received my first Arduino yesterday =] I googled but couldnt find a fix.

So I have an Uno and a 20x4 LCD screen from Adafruit. I followed the tutorial from ladyada very accurately.

Everything works fine. I am able to upload code, make it display text. The problem is when I remove the usb cable (powering it down), and reconnect it (powering up), the LCD displays white boxes on rows 0 and 3. I want it to run the code on start-up. I've tried pressing restart but it doesn't work.

It might do this by default. If so, How can I have it display the text when it powers back on?

Thank you =]

If so, How can I have it display the text when it powers back on?

Display what text?

What code are you running on the Arduino?

The standard "Hello World" example. When I upload the code, shouldn't it be stored in NVRAM? And when it restarts, shouldn't the Arduino load the code?

Could be contrast. Is there a trim pot on the back opf the display (there was on the first one I had) or if not is there a contrast pin and have you wired a pot to it?

see: http://arduino.cc/en/Tutorial/LiquidCrystal

Z

Pin 13 has a built-in LED. Flash the LED with this code inside of loop():

digitalWrite(13, !digitalRead(13));

(Don't forget to put pinMode(13, OUTPUT) in setup());

This should could Pin 13 to either blink or appear to be faded slightly, because it is blinking so fast. At the very least you should see the same behavior before and after you change the USB connection.

Should not be contrast since he made it work already.
Just guessing, are you holding arduino by hand or on a conducting surface? I had this experience that if you are touching the back of arduino you mess up communication to the lcd.

The Arduino has rubber feet on the bottom and on a wooden table.

I tried the light code. I think it is having the same problem. After I upload the code, the light is on. Unplug and replug back in, the light is off. Still think it's an NVRAM problem, but no idea how to remedy.

Not a contrast problem.

The reason I suggested the Flashing LED is to because everyone else jumped on the contrast issue, when it sounds more like the code is not running on power-up.

You said you bought it from Adafruit. I watched part of tonight's "Ask An Engineer" and she made mention about a bootloader problem with her latest batch of Uno. Sounded like code wasn't being saved (or run) properly. I don't have more details but it might be worth an email to her asking if your Uno would be affected or not.

Man, what is wrong with UNOs? I was thinking about buying one to try out the 8u2 functions as HID (mouse keyboard, right?) but I'm not sure anymore. My Duemilanove never gave me any trouble at all.

Thanks everyone. I emailed Adafruit. I guess I'll keep working on my project and wait for a reply. =[

"rows 0 & 3" ??
I'm guessing the second and last lines on the display.

That is very reminiscent of this issue:
http://www.adafruit.com/forums/viewtopic.php?f=8&t=14261

which you can fix with:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1264823411

Everything works fine. I am able to upload code, make it display text. The problem is when I remove the usb cable (powering it down), and reconnect it (powering up), the LCD displays white boxes on rows 0 and 3. I want it to run the code on start-up. I've tried pressing restart but it doesn't work.

It might do this by default. If so, How can I have it display the text when it powers back on?

This sounds like a timing problem that can probably be solved with a long delay before the lcd.begin function.

While you are initially uploading your sketch to the Arduino you probably already have your LCD module powered up. It has had plenty of time to get running before the Arduino sends any instructions to it.

When you simultaneously apply power to a previously programmed Arduino and an LCD module it is a good possibility that the modern microcontroller in the Arduino, running at 16MHz, is already sending commands long before the decades old microcontroller in the LCD controller, running at 270KHz, is ready to accept them.

Don

It's not a LiquidCrystal problem. That's a separate issue I'll deal with later.

I tried the delay. From delay(100) to delay(5000), still does it display white boxes.

I got a replay from Adafruit. "Arduno Uno SMD?" I replied, "Yes, SMD." The waiting game continues!

Thanks again for all the help, guys! Diggin' the Arduino family!

Yeah, I got the impression from the show that the SMD's were suspect. I just couldn't tell if they were ones they already shipped or not.

The white boxes are a result of the LCD getting reset (or power cycled) without anything communicating with it. Your Arduino has amnesia. :wink:

There are several delays during the LCD initialization. The enhanced liquid crystal I pointed you to increases several of them. You can't just increase the delay after power on and get everything right. Since Don's (floresta) impression agrees with mine I would try

http://code.google.com/p/liquidcrystal440/downloads/list

Liquidcrystal4bit.

If this works you have a solution. If its flash amnesia you have a brick wall.

Why would it be a LiquidCrystal issue, if it only works after being immediately programmed? Why wouldn't pressing reset after power-on (which is the same as what happens after programming) work?

Why when the original poster added code to manually flash Pin 13, THAT only works after upload and not power-cycle?

I think the answer, or more correctly the explanation, is here: Arduinos Dont Like Me - adafruit industries.

Of course if the "News" forum on this site worked this would be an appropriate item to include.

Don

Amnesia =[

Adafruit is sending me a new one and prepaid postage to send the old one back. =]

I'll take a look at LiquidCrystal4Bit. Thanks!