16x2 LCD doesn't work correctly when powered on
Moderators: adafruit_support_bill, adafruit

16x2 LCD doesn't work correctly when powered on

by eastbaymike on Sun Jun 05, 2011 7:13 pm

Hello all:

I think this is the same issue as mentioned here: viewtopic.php?f=22&t=20913

Adafruit support has asked me to post as a new topic.

I'm having trouble with the 16x2 LCD kit that I ordered from Adafruit.

When I hook up my LCD following the adafruit tutorial with the "Hello, World" LCD sketch, it works fine when I upload the sketch to the board.

But when I turn off the power, then power up again (both with battery and USB power), the setup() function doesn't appear to run (I tested it by adding an LED that powers on at the beginning of setup). If I press the reset button on my Arduino Uno, the restart functions correctly and the LCD works.

If I remove the LCD connections to my Arduino, then the sketch runs correctly when powered up every time.

Is this likely a hardware problem?
eastbaymike
 
Posts: 6
Joined: Mon May 30, 2011 10:52 pm

Re: 16x2 LCD doesn't work correctly when powered on

by adafruit_support_bill on Mon Jun 06, 2011 6:27 am

I checked out theoriginal post on the topic over at Arduino.cc. The resolution of that problem was:
Well it's a bit embarrassing, but the original LCD I had seems to be working now. I was going ahead with trying to develop a sketch and had occasion to change the Arduino pin assignments that the LCD uses. (I intend to use Adafruit's data logger shield and I believe that pins 10-13 are needed for the SD card interface.) So, I moved the LCD to pins 4-9 and now when I reboot the Arduino, the LCD comes back alive. I'm not sure why the pin assignments should make a difference. There probably were (and still are?) subtle problems with my wiring.


Re-check your wiring. What pins are you using for your LCD?
User avatar
adafruit_support_bill
 
Posts: 31866
Joined: Sat Feb 07, 2009 10:11 am

Re: 16x2 LCD doesn't work correctly when powered on

by eastbaymike on Tue Jun 07, 2011 1:35 am

Hello, and thanks for your response.

I'm following the Character LCD tutorial: http://www.ladyada.net/learn/lcd/charlcd.html

Here's my setup:

Image

My pins are as follows:

LCD:
1 = Ground
2 = 5V
3 = Knob wiper
4 = RS (brown)
5 = Ground
6 = EN (white)
7 = empty
8 = empty
9 = empty
10 = empty
11 = DB4 (blue)
12 = DB5 (green)
13 = DB6 (yellow)
14 = DB7 (yellow)
15 = 5V
16 = Ground

Arduino Uno:
7 = RS (brown)
8 = EN (white)
9 = DB4 (blue)
10 = DB5 (green)
11 = DB6 (yellow)
12 = DB7 (yellow)

Extras:
13 = LED
GND = LED ground

Tonight I tried a different breadboard and switched out all the data wires (it's powering up fine, so I didn't trade out the power wires), and I had the exact same results. If I upload the sketch over USB, it works fine. But if I power down and use battery power or USB power (without reuploading), setup() doesn't seem to get run. If I press the reset button on the Arduino, it works fine. I also tried moving all the wires down to Arduino's 4-9, with the same result.

Here's my sketch, which includes the LED to verify that setup() is running:

Code: Select all | TOGGLE FULL SIZE
#include <digitalWriteFast.h>
#include <LiquidCrystal.h>

#define LED 13

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

void setup() {
  pinMode(LED, OUTPUT);
  digitalWrite(LED, HIGH);

  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);

  // Print a message to the LCD.
  lcd.print("Sad Arduino!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}
eastbaymike
 
Posts: 6
Joined: Mon May 30, 2011 10:52 pm

Re: 16x2 LCD doesn't work correctly when powered on

by adafruit_support_bill on Tue Jun 07, 2011 6:08 am

It is a strange failure mode. But your setup looks fine.
Contact support@adafruit.com about a replacement and be sure to reference this thread in your post.
User avatar
adafruit_support_bill
 
Posts: 31866
Joined: Sat Feb 07, 2009 10:11 am

Re: 16x2 LCD doesn't work correctly when powered on

by eastbaymike on Wed Jun 15, 2011 1:23 am

I'm sad to say that when I tried the replacement LCD today I got the exact same error, so I doubt it's because of the LCD (do you want me to send it back? It's already soldered to the connector pins).

So since I've tried changing wires, which pins I'm using and the breadboard, it seems at this point that the problem has to be with the Arduino Uno, right? Maybe a bug in the powering on sequence in the card's operating system?
eastbaymike
 
Posts: 6
Joined: Mon May 30, 2011 10:52 pm

Re: 16x2 LCD doesn't work correctly when powered on

by adafruit_support_bill on Wed Jun 15, 2011 5:53 am

Does the led on the Uno blink? There was a similar problem reported recently with the optiboot bootloader.
http://code.google.com/p/optiboot/issues/detail?id=40#c3
User avatar
adafruit_support_bill
 
Posts: 31866
Joined: Sat Feb 07, 2009 10:11 am

Re: 16x2 LCD doesn't work correctly when powered on

by eastbaymike on Wed Jun 15, 2011 11:16 pm

No, my "ON" LED doesn't blink when I start it without reuploading code or manually resetting. But I might try an optiboot update in any case.

I'm able to run sketches without my LCD attached fine, so that's what is throwing me off. But it does sound like a similar problem. I'll check it out.
eastbaymike
 
Posts: 6
Joined: Mon May 30, 2011 10:52 pm

Re: 16x2 LCD doesn't work correctly when powered on

by eastbaymike on Wed Jun 15, 2011 11:27 pm

OK, I checked out the optiboot process, and I'm confused. It sounds like I can't update an Uno's firmware with the modified bootloader posted in the link you sent. Is that right? I'm fairly lost at this point.
eastbaymike
 
Posts: 6
Joined: Mon May 30, 2011 10:52 pm

Re: 16x2 LCD doesn't work correctly when powered on

by eastbaymike on Wed Jun 15, 2011 11:57 pm

Well, I got something working, but I sure can't figure out why.

I just started unplugging one wire at a time to see if I could at least get setup() to start running. I noticed that when I had this pin assignment on my Uno, setup() never ran:

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

But when I unplugged RS from 7, setup() runs. The LCD doesn't work right, of course, but the sketch tries to run.

So I reassigned RS to 6, and now the sketch and LCD run perfectly every time:

LiquidCrystal lcd(6, 8, 9, 10, 11, 12);

I figured it might be a bad slot on my Uno board on No. 7, so I tested it with EN in 7, and it works every time this way as well:

LiquidCrystal lcd(6, 7, 9, 10, 11, 12);

Anyone have any ideas as to why this would be so? In any case, it's working now, but weird, right?
eastbaymike
 
Posts: 6
Joined: Mon May 30, 2011 10:52 pm

Re: 16x2 LCD doesn't work correctly when powered on

by adafruit_support_bill on Thu Jun 16, 2011 5:40 am

but weird, right?

Yes :?

On the Arduino-BT, pin 7 is used to reset the BlueTooth module. But I don' know of any similar restriction on the Uno.
User avatar
adafruit_support_bill
 
Posts: 31866
Joined: Sat Feb 07, 2009 10:11 am

Re: 16x2 LCD doesn't work correctly when powered on

by Anonwelder on Sun Jan 08, 2012 8:58 am

Hi All.

First post of mine and I know this thread is old, but it describes my issue precisely, so I would just like to inform people the issue still remains. I have an Arduino Uno too, bought new in December 2011.

I would like to say I have EXACTLY the same problem as the OP. I followed the same guide as OP to the letter re first building the circuit and changing the sketch to accomodate the wiring and then uploaded the sketch. Everything worked as it should, i.e I got "Hello World" and the seconds displayed on the 16*2 LCD.

Powering down then up, (either USB powered or via an external PSU) I just get top line blocks everytime- no text. Only pressing the Ardy reset can I get the LCD working again correctly. I tried a 40*2 LCD and problem is the same. I have a different model Ardy (2009 model) on order and will test with this too at some point after it arrives.

I intend trying the work-around detailed above and post back if I get the same results.

Thanks.

AW.
Anonwelder
 
Posts: 2
Joined: Sun Jan 08, 2012 8:39 am

Re: 16x2 LCD doesn't work correctly when powered on

by Anonwelder on Sun Jan 08, 2012 9:29 am

Okay, Just performed the changes as detailed above i.e moving connection from pin 7 on Arduino Uno SMD to pin 6 and changing the sketch to

LiquidCrystal lcd(6, 8, 9, 10, 11, 12)

and it works perfectly on both LCD's I have.

Thanks again to eastbaymike for his discovery.

AW
Anonwelder
 
Posts: 2
Joined: Sun Jan 08, 2012 8:39 am

Re: 16x2 LCD doesn't work correctly when powered on

by russau on Sat Jan 28, 2012 2:11 am

FWIW - i had the same problem with an Arduino Uno and this LCD from sparkfun. i swapped the Uno with a Freetronics eleven and the problem went away.
russau
 
Posts: 1
Joined: Sat Jan 28, 2012 2:05 am

Re: 16x2 LCD doesn't work correctly when powered on

by adam123 on Thu Dec 27, 2012 1:57 am

So I reassigned RS to 6, and now the sketch and LCD run perfectly every time:

LiquidCrystal lcd(6, 8, 9, 10, 11, 12);

I have this same exact issue with a Noritake Vacuum Fluorescent Display that is supposed to be a drop in replacement for any 4x20 LCD. On power up the display is blank, then when I reset the display activates and works fine.

I reassigned the pins like in the quote above and it works 100% of the time. This must be an Arduino or library issue.
adam123
 
Posts: 1
Joined: Wed Jul 27, 2011 3:13 am

Re: 16x2 LCD doesn't work correctly when powered on

by palitu on Fri Jan 11, 2013 9:12 pm

Hey,

I have quite a bit about this issue, and haven't really found an explanation or proper solution.

I am using a freeduino leonardo,and read somewhere that the LCD needs ~15ms prior to it being initialised. To fix it, i simply put a delay in the setup() function.

haven't had an issue yet.

Code: Select all | TOGGLE FULL SIZE
void setup() {
    delay(20);
    lcd.begin(16, 4);
}
palitu
 
Posts: 1
Joined: Fri Jan 11, 2013 9:06 pm