Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more.
0

LCD outputting wrong letters
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

LCD outputting wrong letters

by staffordj on Sun Sep 13, 2009 4:30 pm

I am using a 16x2 parallel LCD for a temp controller with an Arduino and the updated "liquidcrystal.h". I am getting some very intermittent output errors like this:

Code: lcd << "Fahrenheit";
LCD output: Fahrdnheit
or
Code: lcd << "off";
LCD output: nff

It has only occurred a couple of times and I have a 7 level deep menu, so there is quite a bit of text. If it does happen though it will always repeat on that same word.

Any ideas?

staffordj
 
Posts: 10
Joined: Thu Jul 23, 2009 2:08 pm

Re: LCD outputting wrong letters

by adafruit on Sun Sep 13, 2009 6:43 pm

could be RAM corruption

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: LCD outputting wrong letters

by TheDon125 on Sun Sep 13, 2009 10:14 pm

Have you tried slowing the clock down any (if possible)? Perhaps something just can't keep up.
TheDon125
 
Posts: 23
Joined: Tue Jan 09, 2007 9:58 pm

Re: LCD outputting wrong letters

by Fjornir on Sun Sep 13, 2009 10:45 pm

Which pins are you using to control your LCD? Have you got anything else wired up on any of those pins? Specifically, the low-order bit? I ask because both of the errors you gave show a change in the low-order bit. ie:

e 01100101
d 01100100

Likewise:

o 01101111
n 01101110
Fjornir
 
Posts: 58
Joined: Fri Nov 28, 2008 3:14 pm

Re: LCD outputting wrong letters

by staffordj on Mon Sep 14, 2009 1:08 pm

I am using 4-bit control of the LCD with LCD pins D4, D5, D6, D7 connected to D7, D8, D9, D10 of the arduino, respectively. Nothing else is connected to the pins. If it was a speed issue, I would not expect it to repeat on the same character every time and it would be more prevalent throughout the program, but I am not sure. Again, in the current version of my program, I only see it on one character out of >50 characters that the program prints. Thanks for your help.

staffordj
 
Posts: 10
Joined: Thu Jul 23, 2009 2:08 pm

Re: LCD outputting wrong letters

by richms on Thu Sep 17, 2009 10:26 pm

Can get strange things happening if you dont have decent power, make sure you have a decent ground between the arduino and the display, rather then relying on the ground that is also powering the display, a small cap across the power at the display end can help, and also check that the wires are well connected. The arduino sockets may be convienent but they suck at making good reliable connections. If there is some resistance in the groundbetween the display and arduino it can mess up the signals.

richms
 
Posts: 558
Joined: Tue Jan 20, 2009 3:05 am
Location: New Zealand

Re: LCD outputting wrong letters

by earnestblimp on Thu Nov 26, 2009 3:56 pm

Hi,
Did you ever find a solution to this? I am having a very similar problem. Everything in my circuit works great, except the lcd prints, for example, 78.5 dugrees, (note the mispelling). This is with the $12 16x2 lcd panel at adafruit. Thanks

earnestblimp
 
Posts: 19
Joined: Thu Sep 17, 2009 10:42 am

Re: LCD outputting wrong letters

by zener on Thu Nov 26, 2009 4:06 pm

earnestblimp wrote:the lcd prints, for example, 78.5 dugrees

It might be southern. Try printing "you all" and see if it comes out "yall"

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: LCD outputting wrong letters

by staffordj on Thu Nov 26, 2009 4:55 pm

No, I never resolved the issue. I am in North Carolina, so maybe it is a southern thing.

staffordj
 
Posts: 10
Joined: Thu Jul 23, 2009 2:08 pm

Re: LCD outputting wrong letters

by chelmi on Thu Nov 26, 2009 5:13 pm

Zener wrote:
earnestblimp wrote:the lcd prints, for example, 78.5 dugrees

It might be southern. Try printing "you all" and see if it comes out "yall"


:D

chelmi
 
Posts: 53
Joined: Wed Nov 19, 2008 12:09 pm
Location: Canada

Re: LCD outputting wrong letters

by zener on Fri Nov 27, 2009 4:18 pm

staffordj wrote:No, I never resolved the issue.

Did you try the capacitor on the LCD across power and ground as was suggested?

Did you try diffent pins of the Arduino?

Did you try changing that letter to some other letter with LSD of 1 such as g, i or k? For example try outputting "fahrgnheit".

Do you have a scope?

What brand LCD is it?

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: LCD outputting wrong letters

by staffordj on Fri Nov 27, 2009 7:24 pm

I have tired different pins and through development I have tried changing letters, but nothing systematic. I like the idea of a ram issue. There is no erratic behavior. It has been a few months and the same misplaced letters are always there. It does not change, so power issues, pin issues, clock issues don't seem to correlate. During development the letters that were corrupt were different, and I think they were all one bit off, but for a given program, it was always the same letter that was wrong. I have 6 different menu screens, and only one or two letters in the entire thing are incorrect. The LCD is from a 16x2 parallel from Adafruit; not sure what brand it is.

staffordj
 
Posts: 10
Joined: Thu Jul 23, 2009 2:08 pm

Re: LCD outputting wrong letters

by zener on Fri Nov 27, 2009 9:15 pm

staffordj wrote:There is no erratic behavior. It has been a few months and the same misplaced letters are always there. It does not change, so power issues, pin issues, clock issues don't seem to correlate.

Those issues could be repeatable. Did you try the capacitor on the LCD across power and ground? Do you have a scope?

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: LCD outputting wrong letters

by earnestblimp on Sat Nov 28, 2009 1:52 pm

Hi,
I have some additional information. When I made a simple test program, printing "abcdefghijklmnop" on the first line, and "qrstuvwxyzabcdef" on the second, everything works. Here is the complete program:

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

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

void setup()
{
  lcd.begin(16, 2);
  lcd.display();
  lcd.print("abcdefghijklmnop");
  lcd.setCursor(0,1);
  lcd.print("qrstuvwxyzabcdef");
}

void loop()
{
}

However, when I go back to my original code, and make the setup() and loop() look identical (by commenting out various portions of the code), I get a 't' in the fourth character position, where the 'd' is supposed to be. The only difference between the two programs would seem to be the object code size then (since there are additional functions in my original code, which, although not being called by setup() and loop(), are still compiled and consume bytes in the object code).

I narrowed it down to when the object code size was 2434, things looked good, and when it was 2436, the 't' problem showed up. As I added one more byte to a print string somewhere else in the code (again, in a function that's not actually being called), I could move the problem letter to the left, toward the first character of the lcd display. This suggests to me some kind of corruption on my arduino. Additionally, I swapped out the arduino duemilanove I was using with a mega, and everything works as expected. So, my next step is to replace the Atmel chip on the duemilanove board, and see if the problem goes away. I'm guessing it will, but there's only one way to be sure. :)

earnestblimp
 
Posts: 19
Joined: Thu Sep 17, 2009 10:42 am

Re: LCD outputting wrong letters

by zener on Sat Nov 28, 2009 7:28 pm

I like your approach. I would be surprised if a different chip acts differently but I have been surprised before, many times. I would guess it is a timing issue having something to do with the complied code. But I am just guessing. You are using a library provided by others and it is hard to know what is going on under the hood unless you have a lot more skill than me. My guess is it is not a bad display.

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Please be positive and constructive with your questions and comments.


cron