Problem With 20x4 LCD on Due?

I have three I2C devices on my Due project. The first I2C I/F (Wire) is connected to an FPGA, running the I2C at 2MHz. This works perfectly. The second I2C I/F (Wire1) is connected to an I2C EEROM, and to one of the generic 20x4 LCDs. The EEROM works perfectly by itself. The LCD works perfectly when connected to a ProMini. If I do an I2C device scan, both devices are found at their correct addresses (0x27 for the LCD, 0x50 for the EEROM). But, after I call the lcd init() method, the EEROM stops working, and I have tet to get the LCD to work at all on the Due. I am unable to get the LCD to work by itself, even using the same simple test program that works perfectly on a ProMini.

To deal with the voltage difference, the LCD is connected to the Due via a 330 Ohm series resistor, and a 5.1K pullup to +3.3V on the Due I2C pins. This same interface approach works perfectly with all the other 5V peripherals, including the FPGA.

Are there any known problems with the 20x4 LCD that could be causing this problem? Has anyone here ever run one of these LCDs with a second device on the I2C bus? It uses the same Philips I2C to parallel chip as every other similar LCD I've ever used. Hard to believe Philips could screw up I2C, given that they invented it. And, indeed, it seems to work, as the device scan works perfectly every time.

Regards,
Ray L.

Have you tried using the LCD with the Due and the ordinary 4bit mode connection mode?
I don't know what that would help but that could exclude or prove that the I2C is at fault, I am running a 20x4 LCD with my Due and I supply it 5V as power supply but are connecting the IO pins directly to the LCD and it works just fine.

Regards

RayLivingston:
I have three I2C devices on my Due project. The first I2C I/F (Wire) is connected to an FPGA, running the I2C at 2MHz. This works perfectly. The second I2C I/F (Wire1) is connected to an I2C EEROM, and to one of the generic 20x4 LCDs. The EEROM works perfectly by itself. The LCD works perfectly when connected to a ProMini. If I do an I2C device scan, both devices are found at their correct addresses (0x27 for the LCD, 0x50 for the EEROM). But, after I call the lcd init() method, the EEROM stops working, and I have tet to get the LCD to work at all on the Due. I am unable to get the LCD to work by itself, even using the same simple test program that works perfectly on a ProMini.

To deal with the voltage difference, the LCD is connected to the Due via a 330 Ohm series resistor, and a 5.1K pullup to +3.3V on the Due I2C pins. This same interface approach works perfectly with all the other 5V peripherals, including the FPGA.

Are there any known problems with the 20x4 LCD that could be causing this problem? Has anyone here ever run one of these LCDs with a second device on the I2C bus? It uses the same Philips I2C to parallel chip as every other similar LCD I've ever used. Hard to believe Philips could screw up I2C, given that they invented it. And, indeed, it seems to work, as the device scan works perfectly every time.

Regards,
Ray L.

Hi Ray,

What it sounds like you are doing is running a 5v device with a 3.3v signal. Did you check the output voltage for the high state on the 3.3v device? It has to be high enough to meet the spec for the 5v device. If it is too close it might not work.

Did you get the display to work all by itself with the Due yet? It sounds like you did not. You dont have to wonder how to get it to work with other devices until you at least get it to work by itself.

The operation for the external device would probably be the same for ground, but for the high output state it would push around 5v out on the output pin, which would be at the device end of your 330 ohm resistor, and on the other end it would see a CMOS input with a diode from the input to +3.3v DC. So the 5v device that outputs a 5v high signal would put about 3.8v at the input pin of the Due, given that the internal static discharge diode only drops 0.5v, which is reasonable, provided it has one, and it probably does have one but we should check that i think. 3.8v isnt too bad i guess, but i might be afraid to do that myself.

So the most critical state is probably when the Due is putting out a high, and a high for a 3.3v device might be too low for the required input high for a 5.0v device. If you can you might try lowering the 5v supply slightly for the LCD and see if you get any operation that is better than it is now. If you do, then you know it is receiving a high that is marginal.

Dont they make any universal logic level translators? I am going to have to do this very thing myself and this is my first time with this setup too. I was thinking of looking for a logic level translator chip or something.

The 2004 display uses an 8574 IC2 to parallel converter chip too, just like the 1602 displays, so if it works with a 1602 i would think it would work with a 2004. The other thing though is that if the signals are marginal then it may work sometimes and not other times, such as when the temperature drops or goes up a little. Heating the chip up a little (not too much) may show some signs of working, but then you'll know it is because of the marginal high out of the Due.

Another trick might be to use a pullup on the LCD side and a pull down on the Due side. That would mean the high level signal getting to the LCD would be a little higher.

In any case though a logic level converter is probably the best bet. I am going to look around for one.

[LATER]
I checked the data sheet for the 8574 chip and the electrical sections states that a logical high input is defined as 0.7*Vdd which means 3.5v for a 5v power supply. 3.3v is not close enough to 3.5v to ensure correct operation all the time, if at all.
The only way i see this working reliably is with a logic level translator (shifter) which can safely convert the 3.3v logic to the 5v logic required by the displays with the 8574 chip installed. I would suppose that the 8574A chip has the same input level spec (another version of the chip).