I have successfully connected a 40x2 LCD to my Arduino and got it displaying a message:
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?
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.
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.
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.