Pages: [1]   Go Down
Author Topic: [Solved] LCD crashes on characters with first/last 4 bits = 1111  (Read 1143 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone.

I've been trying to use the 16x2 LCD i have and i've hit a bit of a problem.

Most characters work fine, but any that end or begin with four high bits (1111), clears the display and everything after is garbage. These are characters like 'o', '/' and 'π'.

Has anyone come across this before? I've double checked the wiring and it seems to be fine. I'm running power off the USB is that makes a difference. Here's the code...

Code:
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int backLight = 10;

void setup()
{
  pinMode(backLight, OUTPUT);
  digitalWrite(backLight, HIGH);
  lcd.begin(16,2);
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("o");
}

void loop()
{
}
« Last Edit: February 13, 2013, 04:32:03 am by smnanthny » Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I've double checked the wiring and it seems to be fine.

I suspect that you have a wiring error, and a wild guess would be that you have a problem with LCD DB7.

Don
Logged

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

Hmm, I've double checked it any can't see any issues from wiring. Checked my soldering too as I've added headers to the LCD board but no bridging or anything that could short it

EDIT: Some more info..

It worked just now. I'm printing out the letters of the alphabet with a 500ms delay between each character, and it printed out the 'o' on one or two occasions, but now has gone back to crashing once it reaches that same character =/ I'll try and upload a video to show

EDIT: video..

First time around (500ms delay) it worked once and threw an error once. The second time around (250ms delay) it just never works at all..

« Last Edit: February 12, 2013, 08:49:34 am by smnanthny » Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your wiring cannot be verified without a picture that shows both ends of every wire and the code that goes with the picture.

Do you realize that the horizontal power buses have a gap in the middle?

Your video cannot be adequately interpreted without seeing the code that was used to generate the display.

If you look at the first part of the video, while you are properly displaying the initial characters, you can see faint 'blocks' on both rows of your display.  After you try to display the 'o', while you are displaying the garbage characters, you will notice that you can no longer see blocks in the second row.  This implies that the configuration of the LCD controller has changed and that it is no longer properly set up to send information to a two-row display.  You didn't let either garbage display run long enough to fill up all 80 memory locations so I can't speculate any further.

What happens if you start displaying letters at a different point in the alphabet?  Does it foul up at 'o', at the 15th character, or somewhere else?

Have you tried any other libraries?

Have you tried using some other location on your breadboard?


Don
« Last Edit: February 12, 2013, 01:13:58 pm by floresta » Logged

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

Thanks for the list of thing to check buddy, I'm on my tablet at the moment but when I get back on my PC I'll go through them and rule things out.

As for whether it is the character or the 15th letter, I believe it is the character. I have tried the alphabet from a different point and I've also tried just those affected characters on their own and the same thing happens, I get the dim bar across the whole row and anything after is scrambled.

Thanks for the help thus far though, I'll do some more troubleshooting tomorrow hopefully!
Logged

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

Ok... so I moved everything along because I hadn't bridged the gap in the power rails like you said and now it works perfectly..

Thanks for your help and sorry for wasting your time.

I'm going to hang myself in shame now...
Logged

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

Hi

Could you please put the image of the connection of this project because i faced problems and i want to make the connection like yours 
Logged

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

Here you go mate, hopefully it makes sense as I just threw it together in 5 minutes smiley-kitty

http://i3.photobucket.com/albums/y90/Klu7ch/Untitled-2copy-4_zpsb327e4b3.jpg

I think I moved pins 12 and 11 up one place so that I could use 10 as a PWM channel for the back light, so bare that in mind if you're using a library that requires you to set the pins at the start of your sketch
Logged

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

Thank you  smiley
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 27
Posts: 1184
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This usually mean that the contrasts for the LCD is not set correctly. There is usually a pot that is used to set this.
« Last Edit: March 17, 2013, 02:16:29 pm by marco_c » Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your original thread is marked [solved].  You should start a new one for this new problem.

Don
Logged

Pages: [1]   Go Up
Jump to: