Newhaven Display Forum

Newhaven Products => OLEDs => Topic started by: a_horst on April 06, 2018, 08:25:11 AM

Title: How to reset NHD-0216SZW-BY5?
Post by: a_horst on April 06, 2018, 08:25:11 AM
Hi guys,
I got a NHD-0216SZW-BY5 connected to a Arduino similar board and use the LiquidCrystal library like in your example code (http://www.newhavendisplay.com/exprog_page.html).
Basically i have no troubles to get output on the screen. Only when i reset, upload new code or plug out and in the supply too fast, it starts writing at the wrong position and/or magic numbers.

Due to this I guess the content in the RAMs is not lost fast enough.

So my question now would be - what commands would I have to send initially to the controller to avoid this?

Thanks already in advance for every helpful though/answer. :)
Title: Re: How to reset NHD-0216SZW-BY5?
Post by: Saurabh_B on April 11, 2018, 08:08:16 AM
The first thing you would have to do is to add a short delay when the power is applied.
Then before you start writing I would recommend sending the return home command.

There is also a clear display command that would be able to "reset" the screen to a blank state and move your cursor to the home position as well.

I would recommend adding delays to the end of your write functions. The max execution times are listed in the instruction table.
Page 7 (http://www.newhavendisplay.com/specs/NHD-0216SZW-BY5.pdf)
Title: Re: How to reset NHD-0216SZW-BY5?
Post by: a_horst on April 12, 2018, 04:50:57 AM
Unfortunately this doesn't leads to success

As i noticed in the datasheet at the end a section "Initialization Sequence", do I have to apply this sequence always when turning it on?

Or can I assume that like the "HD44780" and identical controller, it has a internal reset circuit, which (when power is turned on) initializes it to the following:
1.   Display clear
2.   Function set:
    DL = 1; 8-bit interface data
    N = 0; 1-line display
    F = 0; 5 8 dot character font
3.   Display on/off control:
    D = 0; Display off
    C = 0; Cursor off
    B = 0; Blinking off
4.   Entry mode set:
    I/D = 1; Increment by 1
    S = 0; No shift
Title: Re: How to reset NHD-0216SZW-BY5?
Post by: jamespandit on May 05, 2018, 06:18:17 AM
Been encountering a similar issue with NHD-0216SZW-BY5; have you been able to fix it yet?
Title: Re: How to reset NHD-0216SZW-BY5?
Post by: tocnaza on October 23, 2018, 09:08:49 AM
Hi all!

I have the same problem. :(

regards,
Title: Re: How to reset NHD-0216SZW-BY5?
Post by: Alee_S on November 28, 2018, 12:45:43 PM
Unfortunately, the controller in NHD-0216SZW-BY5 is not as similar to the controllers a_horst listed, in that it doesn't have an internal reset counter that resets memory address's to its original location.

The initialization sequence will run anytime the display is reset, so in order to reset the DDRAM address to the original location, it must have the clear screen and return home command at the end of the initialization sequence.

Including those commands should hopefully solve these issues. If something is still wrong, please let us know.
 
Title: Re: How to reset NHD-0216SZW-BY5?
Post by: Jordan82 on July 12, 2019, 12:00:45 AM
The OLED has slightly different timing than the LCD (this can be seen in the datasheets for the displays, specifically the command tables).  One main difference is the clear display command.  With the OLED, you need a minimum of 2ms delay after executing this command.  The other commands have slightly higher execution times as well, so these would also need to be accounted for if the requirements are not being met.

Also, can you make sure pin 3 is left as a no connect?  The same goes for pins 15&16.  You should not need to change any jumpers, as the OLED comes default as 6800 mode like the LCD.
Title: Re: How to reset NHD-0216SZW-BY5?
Post by: Amelia22 on August 08, 2019, 06:47:46 AM
Hi guys,
I got a NHD-0216SZW-BY5 connected to a Arduino similar board and use the LiquidCrystal library like in your example code (http://www.newhavendisplay.com/exprog_page.html).
Basically i have no troubles to get output on the screen. Only when i reset, upload new code or plug out and in the supply too fast, it starts writing at the wrong position and/or magic numbers. tellthebell (https://www.tellthebell.xyz/)

Due to this I guess the content in the RAMs is not lost fast enough.

So my question now would be - what commands would I have to send initially to the controller to avoid this?

Thanks already in advance for every helpful though/answer. :)

I'm having the same problem as the others.