NHD-0420CW Display Upside Down
Display: NHD-0420CW
Interface: I2C with a BeagleBone Black
Usage: Clear display and display text. Nothing more complicated than that.
Problem: Yesterday the display worked as expected - 4 lines of magnificent text.
Today, on power-up, all text is upside down - line 4 is at the top. Characters flow from left to right, as expected, but upside down.
Question: What command do I use to get the text right side up again. I have the US2066 document, but the command explanations in that document are a bit... obscure.
thank you
Charles Bell
-
I reset the display using the active low reset signal (/RES).
Now the characters are right side up, but they are reversed right to left.
Questions:
1. I was assuming that I could rely on the power-on reset values to get basic operation. This doesn't seem to be the case.
2. Does grounding the /RES pin reset the display to the power-on reset state?
Possibility:
I have the /RES pin pulled up to VDD. Should I hold /RES low at power-up to allow VDD to stabilize?0 -
To summarize:
1. Power on: The display is mirrored top to bottom. Characters are upside down.
2. Reset the display by grounding the /RES pin: Display and characters are now right side up, but mirrored right to left.
3. I am generating the characters to display using the simplest commands over an I2C bus -
a. to send a command, 1) send a control byte 0x00 and then 2) send the command byte.
b. to send data 1) send a control byte 0x40 and then 2) send a string of characters.
c. The display on/off commands work as expected.
d. The clear display command works as expected.
e. Set position and send data commands work as expected, except that the positions are upside down or backwards.
And to top it all:
This thing worked fine yesterday. I ran it through 4 hours of testing and then turned it off.
I am sincerely stumped. I have, however, modified my code to allow sending bytes individually using the console. I can pick this apart one byte at a time if I have to but I'm hoping that somebody has seen this before.
Charles Bell0 -
Hi Charles,
Try running the full display initialization sequence before writing the string of characters:void init()
{
RES = 1; //reset HIGH – inactive
delayms(1); //delay
command(0x2A); //function set (extended command set)
command(0x71); //function selection A
data(0x00); // disable internal VDD regulator (2.8V I/O). data(0x5C) = enable regulator (5V I/O)
command(0x28); //function set (fundamental command set)
command(0x08); //display off, cursor off, blink off
command(0x2A); //function set (extended command set)
command(0x79); //OLED command set enabled
command(0xD5); //set display clock divide ratio/oscillator frequency
command(0x70); //set display clock divide ratio/oscillator frequency
command(0x78); //OLED command set disabled
command(0x09); //extended function set (4-lines)
command(0x06); //COM SEG direction
command(0x72); //function selection B
data(0x00); //ROM CGRAM selection
command(0x2A); //function set (extended command set)
command(0x79); //OLED command set enabled
command(0xDA); //set SEG pins hardware configuration
command(0x10); //set SEG pins hardware configuration
command(0xDC); //function selection C
command(0x00); //function selection C
command(0x81); //set contrast control
command(0x7F); //set contrast control
command(0xD9); //set phase length
command(0xF1); //set phase length
command(0xDB); //set VCOMH deselect level
command(0x40); //set VCOMH deselect level
command(0x78); //OLED command set disabled
command(0x28); //function set (fundamental command set)
command(0x01); //clear display
command(0x80); //set DDRAM address to 0x00
command(0x0C); //display ON
delayms(100); //delay
}Regards,
Ted0 -
Just tried it. No change.
I suspect that I may have a fried controller. The static electricity around here is brutal, even though I have all kinds of ESD protection on my bench.
I'll find out soon. Yesterday I ordered two more. This time I'll be even more diligent with the ESD countermeasures.
Thank you for your response. I'll post a follow-up when I test the new display.
Charles Bell0 -
It seems I was mistaken. Maybe. This is too much.
This is a NHD-0420CW-AB3. I have been orienting the display with the row of connector pads at the bottom.
So I just turned it upside down and the thing reads perfectly.
Before you start laughing (too late, I know), I swear it was originally reading the other way.
Further testing to follow. This has got to be a glitch.
If it's not a glitch, I'll have an abundance of displays with which to educate myself.
Charles Red-in-the-Face Bell
Really. This just can't be it.0 -
No worries, just glad to hear you have it working. :)
0 -
I was assuming that, after making the interface pin selection, the other display parameters were already configured at power on.
Perhaps that was the source of my previous confusion.
This will keep me humble for a good long time.0
Please sign in to leave a comment.
Comments
7 comments