Go Down

Topic: LCD does not work unless Arduino is reset. (Read 6696 times) previous topic - next topic

dtokez


I have been following this topic as I had the same type of error. I finally noticed that the two control signals were swapped. (pins 12 and 11). After fixing that I removed all the delays and the many displays that I tested all worked just fine with the LiquidCrystal440 without the R/W signal.


Thanks, I think I will give that a ago later :)

I'm sure its something silly that I'm doing to be experiencing it on 3 different types of display

avr300

#46
Oct 21, 2011, 08:46 pm Last Edit: Oct 22, 2011, 02:37 pm by avr300 Reason: 1
Hi there.

I have some kind of same problem here - with a minor (or major) twist. My UNO is not running at all, until I press the reset.

Explanation: I'm controlling the backlight by PWM measured from a LDR.

When I have the backlight connected (and the datalines to the display but not the Vcc on pin 2) it starts 10 out of 10 times. I say so, because my backlight lights up.

But when the powersupply to the display is connected (pin 2) and the UNO is powered up, the symptoms with square blocks is there. Sometimes, I'll say 1 of 30 it actually starts, but it's rare. Pressing reset always brings the system to a run.

Both happens with USB power or external power.

So, are you sure that your Arduino is running when you see the problem? It explains pretty good why the display remains silent.

Now, why does the Arduino halts ?


edit: solved. Instead of using pin 12,11,10,9,8,7 for display I'm now using pin 12,11,10,9,8,6 and it's now working as expected.

dc42

I'm glad you solved your problem. The first thing I was going to ask is whether you have a resistor connected in series with the backlight. I have used 2 different LCD displays and both needed a series resistor, however some folks assume you don't need one because the Adafruit tutorial says to connect the backlight directly between +5v and ground. Without a series resistor, the backlight is likely to draw far too much current from the +5v supply, unless the display you have already has a resistor included.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

avr300

I am using a current limiting resistor so the backlight is safe.

I still don't get it why connecting D7 from display to pin 7 causes the Arduino to hang. It IS specific D7 to pin 7. And on 2 different displays .

dc42


I still don't get it why connecting D7 from display to pin 7 causes the Arduino to hang. It IS specific D7 to pin 7. And on 2 different displays .


That does seem rather odd, unless either you have inadvertently enabled a pin-change interrupt on pin 7, or pin 7 on your mcu is damaged or faulty. Does the Arduino behave normally if you run the blink sketch, modified to use pin 7 instead of pin 13?
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

justone

This sounds a little like what was described in this thread.

http://arduino.cc/forum/index.php/topic,64256.0.html

Has the R/W line of the LCD been tied to ground?

If left floating the LCD might think it should respond to the last command and set the not busy or busy (I think it's DB7 for the flag).

Redo your sketch to use pin7 and also set the led on the board to on to show the status of the program when it hangs.

When the board freezes  measure the voltage at pin7. If it shows high then that could be the culprit.

avr300

Yes, it runs as supposed.

It also runs fine now, connected the display as 12,11,10,9,8,6 - but not as 12,11,10,9,8,7, where the critical point is connecting display pin 14 (D7) to D7 on Arduino.


avr300

#52
Oct 22, 2011, 07:08 pm Last Edit: Oct 22, 2011, 07:10 pm by avr300 Reason: 1
justone, cross posting. I'll try.

Yes, the R/W is tied to gnd.

avr300

#53
Oct 22, 2011, 07:18 pm Last Edit: Oct 22, 2011, 08:06 pm by avr300 Reason: 1

This sounds a little like what was described in this thread.

http://arduino.cc/forum/index.php/topic,64256.0.html

Has the R/W line of the LCD been tied to ground?

If left floating the LCD might think it should respond to the last command and set the not busy or busy (I think it's DB7 for the flag).

Redo your sketch to use pin7 and also set the led on the board to on to show the status of the program when it hangs.

When the board freezes  measure the voltage at pin7. If it shows high then that could be the culprit.


5v on pin 7. I think you nailed it. Thanks a lot for helping me out here. Now to reading the threat.

Solved - again, this time the right way. As written in the other threat:

"try placing a diode between RESET and +5V on the POWER connector, with the cathode (end with the bar) towards the +5V."
Thanks a lot to robert rozee,, and to you justone for finding that threat.

With a diode in place, it starts 10 out of 10 times.

justone

Just did a little testing just to figure out a question I had. Like why didn't pin8 which is a non pwm pin not cause a lockup(see the thread mentioned for details).Also was it only confined to DB7 of the LCD panel because of its use as a busy flag .

Seems that pin8 (DIO8) is immune in my tests with the lockup. Just tried the top 4 bits DB4-DB7 of the LCD and they all cause a lockup.


avr300


dtokez

Just bumping this thread to the top because I still have the same issue with initialization, maybe someone who has not seen it has some suggestions?


Go Up