Author Topic: NHD-0420CW Display Upside Down  (Read 302 times)

clebell

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
NHD-0420CW Display Upside Down
« on: July 31, 2018, 07:07:42 AM »
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

clebell

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
NHD-0420CW Display Upside Down Update
« Reply #1 on: July 31, 2018, 09:07:51 AM »
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?

clebell

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
NHD-0420CW Display Upside Down - Summary
« Reply #2 on: July 31, 2018, 04:59:50 PM »
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 Bell

Ted_M

  • Administrator
  • Jr. Member
  • *****
  • Posts: 44
  • Karma: 3
    • View Profile
Re: NHD-0420CW Display Upside Down
« Reply #3 on: August 01, 2018, 09:54:21 AM »
Hi Charles,

Try running the full display initialization sequence before writing the string of characters:

Code: [Select]
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,

Ted

clebell

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: NHD-0420CW Display Upside Down
« Reply #4 on: August 01, 2018, 01:07:31 PM »
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 Bell

clebell

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: NHD-0420CW Display Upside Down
« Reply #5 on: August 01, 2018, 04:12:09 PM »
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.

Ted_M

  • Administrator
  • Jr. Member
  • *****
  • Posts: 44
  • Karma: 3
    • View Profile
Re: NHD-0420CW Display Upside Down
« Reply #6 on: August 01, 2018, 05:03:49 PM »
No worries, just glad to hear you have it working. :)

clebell

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: NHD-0420CW Display Upside Down
« Reply #7 on: August 01, 2018, 06:48:54 PM »
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.

 

Blank Display on NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM

Started by SteveCBoard Character LCDs

Replies: 3
Views: 7803
Last post May 13, 2014, 12:04:36 AM
by SteveC
NHD‐C12864A1Z‐FSW‐FBW‐HTT display clears after draw

Started by EdAverillBoard Graphic LCDs

Replies: 6
Views: 9519
Last post November 07, 2014, 08:25:20 AM
by Michael_L
NHD‐4.3‐480272EF‐ATXL#‐CTP | FAN5333 | BBB | Nothing on the Display

Started by Alias_AliasBoard TFTs

Replies: 1
Views: 6618
Last post September 25, 2015, 03:09:24 PM
by Paul_B
Arduino LCD library not working with newhaven display NHD‐0420H1Z‐FL‐GWB-3V3

Started by c2hollowBoard Character LCDs

Replies: 9
Views: 15203
Last post July 10, 2014, 08:46:06 AM
by Michael_L
NHD-0420DZW-AG5 - Display "sometimes" shows only 2 lines

Started by stylonurusBoard OLEDs

Replies: 5
Views: 9029
Last post June 18, 2014, 10:09:49 AM
by Michael_L