Author Topic: NHD-0216MW-IB3 Command Decoder  (Read 1784 times)

BumpSplat

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
NHD-0216MW-IB3 Command Decoder
« on: March 24, 2018, 02:00:27 PM »
I'm using the NHD-0216MW in a serial module (I2C) and am having trouble understanding the commands for the controller.  The US2066 controller uses a couple bits that are hardware set to enable software commands (IS/RE/SD).  It's not clear how these bits are set or cleared using a serial data format.  I've gone through the suggested initialization process found at the end of the datasheet (Page 17).  I'd like to understand how these (and above) commands binary map to the hex values shown.  This will enable me to build my own custom commands.  Basically I'm asking:

"Is there a bit level secret decoder ring for the serial commands listed in the initialization code found listed above?"

Thanks in advance - Tim

Paul_B

  • Administrator
  • Hero Member
  • *****
  • Posts: 301
  • Karma: 17
    • View Profile
Re: NHD-0216MW-IB3 Command Decoder
« Reply #1 on: March 26, 2018, 08:02:39 AM »
Hi Tim,

The IS, RE and SD bits are flags that are internal to the controller. You would set these using the commands that have the flag in as one of their parameters.

To set the RE & IS flags, you would use the Function Set Command:

(See Image1.png)

You could only set the IS flag if the RE Bit is low.

(See Image2.png)

To set the SD flag, you would first need to enter the Extended Command Set by setting the RE bit high, then using the OLED Characterization Command to set the SD Bit high:

BumpSplat

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: NHD-0216MW-IB3 Command Decoder
« Reply #2 on: December 06, 2018, 07:59:54 PM »
Thanks for the help, I stepped away from the problem (used the display primitively) and am looking at it again.  So, I can see the commands used to set the flags; what about the D/C# and R/W# bits?  How do I map the command? I can see a nibble from d7 to d0, that's straight forward.  The other bits though...

Thanks,

Tim

Alee_S

  • Administrator
  • Jr. Member
  • *****
  • Posts: 28
  • Karma: 0
    • View Profile
Re: NHD-0216MW-IB3 Command Decoder
« Reply #3 on: December 20, 2018, 09:23:27 AM »
Hi there!

Contrary to the SD, IS, and RE bits, the D/C and R/W bits hardware pins that are brought out to the User, and can be software controlled. You can connect those pins to a GPIO pin and manually change the state of those bits in your program. 

In your case, since you are using I2C interface mode, The state of R/W and D/C bits are not essential when sending commands. the D/C bit is used for your slave address, and the R/W bit will be tied to ground. Please take a look at (Screenshot #1) for more information about these bits. This table is also found on pg. 5 on the US2066 controller sheet, which is linked below.

US 2066: http://www.newhavendisplay.com/appnotes/datasheets/OLEDs/US2066.pdf

If you were using parallel mode instead, the state of these bits become more important. For example, If you were performing Write Data command, the D/C and R/W bit must be turned HIGH, as shown by (Screenshot #2).

Hope this helps!


 

NHD-C0220BiZ Sometimes Ignoring "Clear Display" Command

Started by dstoverBoard Character LCDs

Replies: 2
Views: 7206
Last post March 27, 2014, 05:41:27 PM
by Michael_L
MOVED: Get Cursor Position Command

Started by Paul_BBoard New Product Wishlists

Replies: 0
Views: 2280
Last post October 12, 2017, 07:40:24 AM
by Paul_B
OLED Display Off Command

Started by AngeloRBoard OLEDs

Replies: 3
Views: 5387
Last post June 16, 2014, 05:45:42 PM
by Michael_L
ILI9341 Command Delay

Started by brybotBoard TFTs

Replies: 2
Views: 5208
Last post November 23, 2014, 10:32:09 AM
by PeterT
What hex command to invert text

Started by andysBoard OLEDs

Replies: 5
Views: 5510
Last post November 26, 2015, 11:08:32 PM
by swadhin