Pages: 1 2 3 [4]   Go Down
Author Topic: LCD does not work unless Arduino is reset.  (Read 4744 times)
0 Members and 1 Guest are viewing this topic.
South UK
Offline Offline
God Member
*****
Karma: 2
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

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

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: October 22, 2011, 07:37:33 am by avr300 » Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 .
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

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.

Offline Offline
Full Member
***
Karma: 1
Posts: 159
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

justone, cross posting. I'll try.

Yes, the R/W is tied to gnd.
« Last Edit: October 22, 2011, 12:10:24 pm by avr300 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: October 22, 2011, 01:06:18 pm by avr300 » Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 159
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I only saw it with DB7 to pin 7.
Logged

South UK
Offline Offline
God Member
*****
Karma: 2
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Logged

Pages: 1 2 3 [4]   Go Up
Jump to: