Pages: 1 [2]   Go Down
Author Topic: LCD not working  (Read 1604 times)
0 Members and 1 Guest are viewing this topic.
Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4111
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Matchlighter:
I'm glad that your display is working, but your explanation of the fix is probably not correct if I understand you correctly.

As far as the present version of the LiquidCrystal library (Arduino v0018) is concerned there is no difference between a 16x2 and a 20x4 display.  The code that parses the lcd.begin() entry ignores the first number and only checks to see if the second number is either 1 or greater than 1.

Don
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, all i know is that when I set it to 20x4 it didn't work and when I set it to 16x2 it worked. And I am pretty sure my wiring was correct. If what you say is true, it may have been trying to address a 40x4 or something like that.
« Last Edit: September 04, 2010, 09:15:08 am by Matchlighter » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Now that I am playing with it, it is doing something else weird. If a line is off the screen it goes to a different line. Even when it is supposed to be autoscrolling. If line 1 is too long it goes to line 3 then 2 then 4. Have you ever had a problem like this? Do you know what the problem is and how to fix it?
Logged

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

Quote
Have you ever had a problem like this?
"It's not a bug, it's a feature".  Follow the LCD Addressing link at http://web.alfredstate.edu/weimandn for an explanation.  

Also - the display does not 'scroll', it 'shifts.'  Search for the phrase "Cursor or Display Shift"in the HD44780 datasheet.  It is unfortunate that the authors of the library used the term 'scroll', the word does not appear anywhere in the LCD documentation.

Quote
Do you know what the problem is ...
Yes - it is explained in the link above.

Quote
... and how to fix it?
With software.  Check out the LiquidCrystal440 library.

Don
« Last Edit: September 04, 2010, 09:32:40 pm by floresta » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The LiquidCrystal 440 library does help, but it still goes from line 1 to 3 to 2 to 4 when autoscrolling. It doesn't even keep autoscrolling. If I start it on line 1 then tell it to autoscroll, it goes down to the end of line 3 and stops, no animation whatsoever.
Logged

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

Once again - the LCD module itself does not inherently have the ability to scroll, either automatically or manually, it can only shift.  If you want it to scroll and you don't like the capabilities of other libraries then you will have to write your own software.

Quote
but it still goes from line 1 to 3 to 2 to 4
Did you follow the link in reply #18 to find out the reason for this behavior?

Don
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I did follow the link, but I don't quite get it. If I tell the LCD440 Library to autoscroll, why does it go onto a different line? Shouldn't it stay on one line? And why does it get super mixed up when I tell it to scroll with multiple lines? Characters end up where they aren't supposed to be.
Logged

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

Quote
Yes, I did follow the link, but I don't quite get it. If I tell the LCD440 Library to autoscroll, why does it go onto a different line? Shouldn't it stay on one line? And why does it get super mixed up when I tell it to scroll with multiple lines?
It all boils down to fully understanding the contents of the link and the limitations of the LCD controller.

When the LCD controller shifts (scrolls, in Arduino speak) information horizontally it merely moves information from one memory address to an adjacent address.   The LCD controller cannot account for where this information will show up on the screen since there is no way of telling the controller what screen configuration is being used  (20x4 vs 40x2 for example).  It is therefore up to the programming of the host controller (the Arduino) to do this, but neither the LiquidCrystal library or the LiquidCrystal440 library attempt to do this.

What you want to do is not too hard to accomplish for any one display configuration.  Writing a library to handle all of the various display configurations that are available is another story entirely.

Don
Logged

Pages: 1 [2]   Go Up
Jump to: