chipKIT® Development Platform

Inspired by Arduino™

LCD Problem

Created Sat, 07 Jan 2012 17:09:25 +0000 by Al Bethke


Al Bethke

Sat, 07 Jan 2012 17:09:25 +0000

I'm trying to use a 20 x 4 5V LCD I have with my new chipKIT Max32. Since the LCD expects 5V logic, I am passing the RS, enable, and data D4-D7 lines through a SN74HCT541N (line buffer/driver) IC. I've connected the R/W and V0 (contrast) lines to ground and the D0-D3 lines are unconnected. This is the way the Arduino LCD examples page says to wire the LCD, except that I just grounded the contrast pin (for maximum contrast) rather than connecting it through a potentiometer. When I run the Hello, world! sketch, I see 20 solid rectangular "characters" in rows 0 and 2, with nothing in rows 1 and 3. This pattern shows up immediately, as soon as I turn on the power - before the board even finishes initializing - and it does not change thereafter.

I verified that the LCD is good by connecting it to my 3 pi robot. It works fine. Then I tried connecting it to the 3 pi with the data passing through the SN74HCT541N chip. That did not work, sometimes producing a small number of changing random characters. This makes me think that maybe the timing is so critical that putting the line buffer in the circuit messes it up, but these chips are designed for this type of thing and that's hard to believe. I also tried grounding the LCD R/W line instead of connecting it to the R/W pin on the 3 pi, and that produced the same pattern as when I connected the LCD to my Max32. This makes me think that I need to do something more than simply ground the R/W line, but what?

I'm doing all this with the line buffer IC on a solderless breadboard and I wonder if that causes any problems. Maybe it would all work if I used a prototyping board and soldered it all together.

Has anyone successfully used a 5V LCD with a Max32 or Uno32? Has anyone tested the LiquidCrystal library and the Hello, world! sketch? Any suggestions for how to proceed will be appreciated.

(I will probably purchase a 3.3V LCD soon, but these are hard to find... It appears that DigiKey sells one made by New Haven Display: NHD-0420DZ-FL-YBW-33V3.)

Thanks for any suggestions.


les1943

Sat, 07 Jan 2012 22:27:29 +0000

I gave up trying to use lcd library, and put 4x20 5v on an I2C port expander,(gets over 3.3v probs and gives you two more I/O s), had it going in a flash , and my C++ code is that of a 4 year old.