SSD1332

Hello, I would like for an electronic organ build 64 Electronic labels. I bought 64 0.95 pouces color oled display. They work by SPI. Using SSD1332 adafruit library That works fine with four display. My concern is about SPI. It seems after some tests I need to address from Arduino the CS and Reset pins for each display. I believed CS was enough but in fact no. So I need 128 outputs from de Arduino instead of the 64 wished. My question is why Reset pin should be specificaly adresse and how to get 128 outputs from the Arduino ? As you guess I would like reduce at minimum the wiring. Dc, mosi and miso are common and are OK to work. Hope I'm clear :confused: Thanks in advance.

The interface on those displays is not standard SPI.

@wangelis53,

it looks like you can use -1 for rst_pin in the constructor:

  Adafruit_SSD1306(int8_t rst_pin = -1);

So you can reset all your OLEDs at once in setup() with a low pulse on the common rst pin, before calling begin() for the individual OLEDs.

This technique avoids to reset OLEDs that have already been initialized by the next begin() if using common rst pin.

Jean-Marc

Thanks Jean Marc. (French ?) I'm not familiar with this kind of libraru. How do you produce "a low reset" for all display ? I expect all reset pins are connected together but are they connected to the Arduino ? Thanks really for your help.

First off. Please post a link to the actual display(s) that you bought. e.g. Ebay sale page

And post a link to the library that you want to use.
I can't find any Adafruit_SSD1332 on Adafruit's Github repositories.

I can find GitHub - adafruit/Adafruit-SSD1331-OLED-Driver-Library-for-Arduino: For 0.96" OLEDs in the Adafruit shop

And I can find a library from Sumotoy. GitHub - sumotoy/SSD_13XX: A very fast and full featured driver for SSD1331/22/32/51 Oled's compatible with Teensy's and many other MCU's

David.

@David,

not the first time I fell into this trap searching on GitHub; I searched for SSD1332 and didn't notice.

But there is GitHub - adafruit/Adafruit-SSD1331-OLED-Driver-Library-for-Arduino: For 0.96" OLEDs in the Adafruit shop

For 0.96" OLEDs in the Adafruit shop

with:

Adafruit_SSD1331(SPIClass *spi, int8_t cs, int8_t dc, int8_t rst = -1);

@wangelis53,

#define RST_PIN x // your common pin for all rst lines
pinMode(RST_PIN, OUTPUT);
digitalWrite(RST_PIN, LOW);
delay(20); // 20ms usually is enough
digitalWrite(RST_PIN, HIGH);

Jean-Marc

OK David here is the display: Écran OLED couleur SPI 0.95 pouces, résolution SSD1331 96x64, pour Arduino NEW | AliExpress

and the library : GitHub - adafruit/Adafruit-SSD1331-OLED-Driver-Library-for-Arduino: For 0.96" OLEDs in the Adafruit shop

Sorry read 1331 instead of 1332 in my previous posts

Thanks a lot Jean Marc, that works perfectly !!! You save my wiring !

I was thinking to use a MEGA2560 for this project. Lot of memory and output I/O, good idea ? I need 64 outputs for CS but maybe with a shield or multiplexer ?

wangelis53:
Thanks a lot Jean Marc, that works perfectly !!! You save my wiring !

I was thinking to use a MEGA2560 for this project. Lot of memory and output I/O, good idea ? I need 64 outputs for CS but maybe with a shield or multiplexer ?

This is a question David could answer best. There are a lot of options, e.g. also port expanders, even cascade-able ones.

BTW: my native language is Swiss German, but I was born in Geneva.

Jean-Marc

There are links to more information here:
https://www.digikey.com/product-detail/en/parallax-inc/28087/28087PAR-ND/6561022

From the datasheet:
"MCU bus interface selection pins.
Table 3 - Bus Interface selection
BS[3:0] Bus Interface Selection
0000 SPI
0100 8-bit 6800 parallel
0101 16-bit 6800 parallel
0110 8-bit 8080 parallel
0111 16-bit 8080 parallel
1100 9-bit 6800 parallel
1110 9-bit 8080 parallel "


So you need CS/ to each one, and Reset/ and D-C/ in common to all.
A bank of shift registers could be used to enable the CS/.
If 74HC595 are used with pullup resistors on the outputs, then data could be loaded in, and the CS/ could be used to drive the OE/ pin of the shift register.
Use a resistor network array, one pin to 5V, the others to the individual outputs

Say you were to be sending data to display #10. It's chip select would come from '595 #2. #1 and #3-8 would all be inactive. So you would send out data of 0xFF, 0xb11111101, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, to the shift registers.
Then perform normal Writes to the display. The one '595 output that had a 0 would one output go low and enable the one device to react to the command. You wouldn't need to write to the shift registers again until you were ready to talk to the next device.
This does have the disadvantage of needing pullup resistors on the outputs, but that's a small one-time hardware setup vs the ease of the code having a 'bank select' to add in and then using normal SPI commands from whatever library you are using.

One of the Parallax files, oledc.h, mentions this:
" * At Parallax, we would like to thank Adafruit Industries as parts of this library

  • were dervied from the Adafruit GFX library for Arduino."
    so that library could possibly used with normal CS/ accesses to talk to the chip selected by the "bank select" shift registers.
digitalWrite (bankSelectLatch, LOW);
for (x = 0; x<8; x=x+1){
SPI.transfer(bankSelectArray[x]); // simple array of 64 x 8 with one zero in each group of 8. 512 bytes, put on Progmem
}
digitalWrite (bankSelectLatch, HIGH); // moves the data to the output register

Now access the selected chip. I imagine this section would be replaced by a library call, 
which might be a group of SPI transfers, see the SSD1780 data sheet.

digitalWrite (commandData, HIGH or LOW); // high = data, low = command
digitalWrite (displayCS, LOW);
SPI.transfer (data or command info);
digitalWrite (displayCS, HIGH);