Pages: [1]   Go Down
Author Topic: Trouble with HD44780 LCD  (Read 480 times)
0 Members and 1 Guest are viewing this topic.
Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have successfully connected a 40x2 LCD to my Arduino and got it displaying a message:

http://www.flickr.com/photos/anachrocomputer/3216168181/

Things start going a bit peculiar, though, when I unplug the LCD (with the power off!) and plug in a 16x1 LCD.  The text appears as just a row of junk characters, and sometimes changes when I reset the Arduino (which makes the sketch re-send the data).  I'm using the official LiquidCrystal library in 4-bit mode.

Now, the smaller LCD has a genuine Hitachi HD44780 chip on it, while the big one is a clone.  In the code for the library, I see that there are no time delays between the calls to digitalWrite that set the Enable pin high and then low.  I'm going to try a few things in there, and see if I can fix it.

Has anyone else seen troubles with LCDs that have a genuine HD44780 chip?
Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Update: it's the delays after writing bytes to the chip that are missing.  The data sheet says 37us, so I've put in some 40us delays and it works a lot better.  Still not quite right, though.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you post the changes you made to the code?  It would be good to update the library so it works with the real chip.
Logged

Bristol, UK
Offline Offline
Edison Member
*
Karma: 1
Posts: 1197
Exhibitor at UK Maker Faire
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I'll post 'em as soon as it's 100% reliable!  Still not quite there...

Trouble is, it'll slow down the operation of LCDs that use HD44780 clone chips, which seem to be capable of working without the delays.  The real solution is to use the "Ready" bit from the LCD, but the current library code doesn't do that.  It never reads any status data back from the LCD, in fact.

Should I consider implementing "Ready" bit read-back?  It'll make the library code bigger.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It'd be great to have all the possibilities available, although I'm not sure how much work you want to do.  Once they're implemented, it's easier to judge which makes most sense for the various use cases.
Logged

Pages: [1]   Go Up
Jump to: