NHD-0216AW-SB3 for Arduino/Genuino Uno?


I have a Newhaven NHD-0216AW-SB3 display which has example code that works on an Arduino/Genuino Mega, but I want to use the display on an Arduino/Genuino Uno.

I have been able to operate the display on a Mega, however, the display only seems to function on SOME of the digital I/O ports (it works fine when mapped to ports between 22-53, but doesn’t do anything when remapped to pins from 0-13).

When trying to use the NHD display with the Uno, the display also doesn’t work (when mapped for digital I/O pins between 0-13).

I am not sure why some I/O pins work fine while others don’t.

The code that I am using is in the default NHD_US2066.cpp and NHD_US2066.h files, and the example code NHD_0216AW_XB3.ino.

Thanks for any help!

NHD_0216AW_XB3.ino (2.07 KB)

NHD_US2066.cpp (6.63 KB)

NHD_US2066.h (475 Bytes)

You need to set CS and RES as output in the init_oled() function and the set and CS low, the code to set RES high is already there, but RES had not been defined as output so only the pullup would be activated.

Setting the CS line to output and low and the RES line to output was done for a Mega with these lines which you deleted without recognizing what they were doing...

DDRA = 0xFF; PORTA = 0x00; DDRC = 0xFF; PORTC = 0x00;