Newhaven Display Forum

Newhaven Products => OLEDs => Topic started by: jcasey on August 09, 2017, 12:30:03 PM

Title: spontaneous reverse mode with NHD-0420CW
Post by: jcasey on August 09, 2017, 12:30:03 PM
Hi -   I used an NHD-0420CW for a recent product.   Early on, I noted that sometimes it powered up reversed, so I appended a control 0x20 to the init sequence, and that seemed to fix it.   I have delivered a couple units, and now the customer says that one of them spontaneously reversed itself and won't go back normal on powerup.   I'm perplexed.

Below is my init sequence, applied once at powerup.  I never use reverse at all, but I do go back and forth between 3-line and 4-line format (3-line with middle line double size), so am regularly sending control sequences for this.      (Edit - I'm talking to this in SPI mode, if that matters.)

  1)  I don't understand something, and need to be sending additional init, or regularly goosing mode.
  2)  The LCD is damaged (client did mention something about a power outage during an electrical storm, but system is well grounded and good filtering on line input).
  3)  I'm using the ribbon connector soldered on the back, and perhaps it came loose during shipment, might be an intermittent pin connection.
  4)  ???

This is high end hardware for a national lab, high visibility.  I'm a bit embarrassed over this, need a confident fix fast.  Please help.
(System is running ARM-ASM on an NXP LPC2468 cpu, bare assy, no os.)

Jeff Casey
Rockfield Research Inc.
Las Vegas, NV

init sequence:

   bl   msec1

   write   FIO4CLR,1<<12         ; pull DRESET low for display
   bl   usec500            ; pause a bit
   write   FIO4SET,1<<12
   bl   usec500

   dcom   0x2A      ; function set extended
   dcom   0x71      ; function sel A
   ddata   0      ; disable internal VDD reg, enable reg 5V
   bl   flushd

   dcom   0x28      ; func set
   dcom   0x08      ; displ off, curs off, blink off
   bl   flushd

   dcom   0x2A      ; func set
   dcom   0x79      ; oled com set enabled
   bl   flushd

   dcom   0xD5      ; set clock
   dcom   0x70      ; set clock
   dcom   0x78      ; OLED com set disabled
   bl   flushd

   dcom   0x09      ; ext func 4 lines
   dcom   0x06      ; com seg dir
   dcom   0x72      ; func sel B
   ddata   0      ; ROM cgram sel
   bl   flushd

   dcom   0x2A      ; func set
   dcom   0x79      ; OLED com set enabled
   bl   flushd

   dcom   0xDA      ; set seg pins config
   dcom   0x10      ; ...
   dcom   0xDC      ; func sel C
   dcom   0      ; ..
   bl   flushd

   dcom   0x81      ; set contrast control
   dcom    0x7F      ; ...
   bl   flushd

   dcom   0xD9      ; set ph length
   dcom   0xF1      ; ...
   bl   flushd

   dcom   0xDB      ; set VCOMH
   dcom   0x40      ; ...
   bl   flushd

   dcom   0x78      ; OLED com set disabled
   dcom   0x28      ; func set
   dcom   0x01      ; clear
   dcom   0x80      ; set addr 00
   dcom   0x0C      ; display on

   dcom   0x20      ; added *** later, ensures display is not reversed....?

   bl   flushd
Title: Re: spontaneous reverse mode with NHD-0420CW
Post by: Saurabh_B on August 14, 2017, 09:57:30 AM

Would it be possible to add another set of commands to your initialization?
There are a few ways this display allows you to switch the text so that you can get reversed text or even upside down.

This is often controlled by the Entry Mode Set (extended [RE = 1]).

If the display is reversed (Characters coming from right to left, i would recommend possibly reversing the Segments (BDS = 0)

You can find more information about this on the controller datasheet pages 26, 33 & 35.
Datasheet Link:
Title: Re: spontaneous reverse mode with NHD-0420CW
Post by: jcasey on August 14, 2017, 02:06:13 PM
I can easily modify the init sequence.   Can you recommend some specific strings of characters to add?
I originally used the init sequence recommended in the manual -- the reversal is not supposed to occur on powerup.
I did find that the one appended command i showed solved the problem I originally had (occasional boot up reversed).
Now it appears to always come up reversed...again, this is not supposed to happen.

However, if I can change the init sequence, I'm happy to.   If there are several ways it can become corrupted backwards, what are ALL the commands to make it right-side up and left to right?
I find the manual to be a bit obtuse, and clearly I missed some items.
Title: Re: spontaneous reverse mode with NHD-0420CW
Post by: Saurabh_B on August 15, 2017, 08:25:30 AM
The options that would allow you to remap the output would include the Entry Mode set as i mentioned in my previous post, along with the Set SEG Pins Hardware Configuration command on the OLED Command Set Table (RE = 1, SD = 1)

Attached is the layout for the COM and SEG lines on our OLED.
The Segment Remap command is better explained on Pages 33 & 34 of the controller datasheet (