Go Down

Topic: LCD not working (Read 2 times) previous topic - next topic

floresta

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

Matchlighter

#16
Sep 04, 2010, 04:14 pm Last Edit: Sep 04, 2010, 04:15 pm by Matchlighter Reason: 1
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.

Matchlighter

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?

floresta

#18
Sep 05, 2010, 04:21 am Last Edit: Sep 05, 2010, 04:32 am by floresta Reason: 1
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

Matchlighter

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.

floresta

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

Matchlighter

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.

floresta

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

Go Up