Unable to print to second row of character LCD
I'm using the NHD-02161Z-FSY-YBW-C
I had a prototype setup which works as expected.But in my fabbed board the final board I cannot print to the second line.
It is the same physical display I am testing with in both cases so it isn't a display HW problem per-se. In both cases I'm using 4-bit mode and the Arduino library "newhavendisplay/NHD_Character_LCD@^1.0.0". It is a different micro controller but I can't see how that would matter.
What kinds of errors on my part would result in normal operation except not being able to write to the second line?
-
Update:
The behavior on the old system is intermittently incorrect. again/recompiling/rebooting it that also won't print to the second line. Then after powering down /rebooting again it started to print to the second line.
Maybe there is a DDRAM issue for that second line?
Is there some power sequencing or timing which is critical here?
More data: From a cold start
on-> display operates normally -> Reset uC -> second line won't write. POwer down/up -> second line glitch persists -> power down. short/ground all pins -> power up -> display operates normally0 -
The culprit was the wake sequence! The one in the library does NOT work, at least in 4-bit mode. It also does not match the datasheet. I have no idea why the wake sequence changes whether or not line 2 can be written to subsequently but i put my solution here to help anyone else who find themselves in this position.
Manufacturer's Arduino library wake function. It works only under certain startup conditions.
void NHD_Character_LCD::wakeup()
{
command(0x30);
delay(30);
command(0x30);
delay(10);
command(0x30);
delay(10);
}This one works consistently on an Uno in 4-bit mode, and I'd claim it better matches the datasheet
void NHD_Character_LCD::wakeup()
{
delay(100);
setCommandMode();
setWriteMode();
set4bitDataPins(0x30);
delay(30);
dataLatch();
delay(30);
dataLatch();
delay(30);
dataLatch();
delay(10);
}the above does NOT work on a board with my Teensy. I don't know why, maybe a timing issue, maybe a level shifter, but if you simply repeat the Uno sequence above, that does work.
0 -
Hi Adam,
Thank you for sharing the issue and for providing the working solution. It is likely that the original library was written specifically for 8-bit mode. The issue may also be related to the logic level differences between the Teensy (3.3V) and Arduino Uno (5V). I'm glad the display is now working for you.
0 -
Hi, There is a level shifter for 3.3V to 5V between the microcontroller and the display so I don't think that is the issue, unless it is somehow related to a propagation delay but i find that unlikely given with how slow the comms are here.
0
Please sign in to leave a comment.
Comments
4 comments