chipKIT® Development Platform

Inspired by Arduino™

LCD 20x4 wrong characters

Created Thu, 28 Aug 2014 09:31:52 +0000 by tcsaba101


tcsaba101

Thu, 28 Aug 2014 09:31:52 +0000

I am developing an SD logger usig Fubarino SD, LCD 20x4, 3231RTC, INA226 current sensor. The LCD got mixed up content sometimes after reset. See pictures.

[attachment=0]20140828_095154.jpg[/attachment] [attachment=1]20140828_095208.jpg[/attachment] It is used in 4bit paralell mode. I am not able to reset in runtime if this happened at restart, i have to restart still the displlay looks fine.

I suppose this is due to the 5V LCD and 3,3V PIC treshold level inconsistence.

The 16x2 LCD works fine, no issue.

Any idea to handle?

Csaba


majenko

Thu, 28 Aug 2014 11:02:53 +0000

It could be the difference in signal levels, yes. You could try running the display at 3.3V (some will, some won't - try it, you won't damage it by under-powering it). Alternatively a small level shifter made from any suitable 74HCTxxx chip (octal buffer, AND gates with inputs tied together, for instance) would boost the signal to 5V reliably. Make sure it's the HCT version not the HC version as the HCT version has "TTL" level inputs, which has a HIGH threshold of (IIRC) 2V, regardless of the supply voltage (the HC version is a percentage of the supply voltage not a fixed value).

Alternatively, if it only ever happens after a "soft" reboot - i.e., pressing the reset switch or loading a new sketch - but is fine after a "hard" reboot - i.e., removing the power - then it could be that the display is in a confused state and doesn't know how to recover from it. This could be down to the initialization code in the LCD library not reinitializing the display properly. You could try running it in 8 bit mode to see if this helps it avoid the confusion.


tcsaba101

Fri, 29 Aug 2014 03:42:01 +0000

Thanks for the hw solution idea.

Also the lcd equipped with i2c shift register adapter could be a solution to avoid the levelling problem. But I like better the direct control if I have enough port and wire.

The issue only happens after soft reset, never after hard reset.

This LCD don't want to work properly on 3.2V what I have on board.

THE 8BIT CONFIG WORKS FLAWLESS! :D

So the 4 bit init has problem in the lib or in the lcd controller itself.

But this can be a unique parametric problem too. As I noted the 16x2 lcd works, no issue. I don't have more direct driven lcd's in my hand, only i2c, so I can't check it on other species right now. I have orderd some new ones and I will see later.

On this breadboard setup the i2c bus sometimes stucks after restart. And it remains in this state for some restarts. Running an i2c scanner no address found on the bus. Moving the jumpers, some new tries and by the time I would have switched on my scope, it has get back to operation. The i2cscanner founds all the three addresses. At least the direct driven lcd is working in this situation and the issue can be tracked..

I dont know what is the specified current, resistance rating for the bradboards. But I suspect that this breadboard from china is not the best quality as this example shows: I am sampling in this early test setup the backlight current of the lcd on a 20mohm resistor. The real current is around 140mA. But sometimes the display shows more than 3A! Touching the contacts of the shunt resistors current the displayed value goes under 0,3A. Still has a distinct contact resistance and voltage drop at 140mA.

So maybe the i2c wires has some contact ambiguity on the breadboard altough has much less current on it.

Can someone recommend a good quality breadboard source?