Hi,I will be using this module to display the frequency and signal strength for a receiver I am building. The device controlling all functions of the receiver is an Atmel XMEGA256A3BU Xplained board. SPI is working fine on this board and currently controls two digital synthesizers and a relay board to select 1 of 15 band pass filters.

I read in the module documentation that this module uses the US2066 display controller. I downloaded the document for the US2066 controller and now understand the format of the data/commands to be sent to the display. The command descriptions in section 7 and the three command tables in section 6 indicate that three signals (IS, RE, SD) need to be set for the controller to correctly identify which command the user wishes to execute. I could not locate data in the documentation that references how to set these three signals.

Any code snips to initialize the display module would be very helpful, as well.

Next, (IS, RE and SD) will need to be configured correctly in order for the controller to correctly identify which command the user wishes to execute. Take a look at the initialization sequence (File: NHD_US2066.cpp). The code is heavily commented and should clear up any questions.

Hi Paul,Thanks for the assistance. Unfortunately, no joy yet. The code I wrote is below. I did change a few of the commands, as I have a 2x16 display, and the code on the US2066 directory I think is for a 4-line display. Also, I am using 5V digital logic, so I changed that command. I think all else is the same. The SPI is definitely sending least significant bit first, and the /CS line is going low before the data is transmitted. I am using a board with 2n7000-based level shifters for clock, SDI, and /CS. /RES is tied to +5V.

I also tried the initialization code at a much lower baud rate, without success.

The following pins are tied to +5V:2,3,16The following lines are tied to 0V:1,4,5,6,10,11,12,13,14,17,18,19,20The following pins are connected to the SPI port on the Atmel processor, first passing through a level-shifter board7 - SPI clock8 - SPI data out from 9 - Floating15 - /CS

Hi Paul,Thinking there might be an issue using the SPI on the Atmel processor, i rewrote the c code in the example program in AVR assembler, and would love to share the code with the forum, and the display is now working - almost. The issue seems to be now the required delay for the various commands. Do you or someone on the forum have any guidelines on required delays for a few of the commands requiring such? It seems as if a delay will be required if the /RES line is brought low and high, and the display on command seems to require quite a long delay (.1 seconds?)

I am currently in a situation very similar to the one you were in a couple of weeks back. I likewise am working with a screen that has a US2066 driver and am looking to use SPI for communication. The two differences between our setups is that my screen is 2x20 (instead of your 2x16) and I am running it in 'Low Voltage' mode (instead of your 5v mode).

I've cross compared my setup code with yours and have identified two points of deviation. One pertains to 3v versus 5v mode and thus is to be expected. The other difference I couldn't resolve/figure out what you were setting. I've highlighted the one in question below.

Looking at the driver datasheet I could not resolve what the commands was (it seemed to deviate from the table). For reference I'm looking at the second line in the row dedicated to the 'command' named 'Function Selection C' on page 32 of the driver's datasheet (http://www.newhavendisplay.com/app_notes/US2066.pdf).

I am wondering if you changed this - or any other lines in your initialization - in between your posting it and your getting the OLED screen to work?

Secondly, it sounds as though you ended up placing delays at certain points in your code to help it function. In addition to the delays related to 'reset', did you also decide to place a blanket delay after each command/data byte is sent?

Thank you very much Fred, I greatly appreciate any insight you can provide!

Hi,I found it expeditious to change the interface to parallel. Uses many more pins, but the display works perfectly now. One thing I will say, is that by verifying the command has completed by reading the BF before sending the next command certainly removed any issues from the display initialization. If I had implemented the logic to check the BF flag in serial mode, I believe I would not have had a problem initializing the display. But, can't be certain, since I did not implement that code in SPI mode. Since I got this working using the 8080 8-bit interface, I will not be revisiting initializing and using this chip using SPI. The controller is the Atmel XMEGA 256A3BU developer kit. Port C (J1) is used for the parallel data, and using SPI on port E (J4) for communication to two DDS modules and a 16 port relay board.