Two SPI devices don't like each other

Hi,

in a project I'm using a 1" OLED display and an SD Card module on an Arduiono Nano 328. Each device works on it's own, but they don't work simultaneously.

As they are both SPI, I guess they must be configured as MASTER and SLAVE. To my little knowledge this is done by the SS (Slave Select) line of each device. If that line is HIGH, the
device is master, if its LOW it is slave. Unfortunately, none of the devices has a SS input.

The OLED module has the CS line hardwired to ground, so I guess it must be slave. With the SD CS line connected to pin 10 (default SS output pin on the Arduino) it works, but the OLED shows jibberish.

This is the display
http://www.electrodragon.com/product/0-96-12864-oled-display-iicspi/
and this is the SD card module

I'm using the default SD.h library from the Arduino examples for the SD card module and the Adafruit_SSD1306 library for the OLED.

My question is first and foremost: can these two devices work simultaneously at all? And if yes, how do I tell each device who's to receive the data?

Christina

Without SS (CS) inputs, I think it is impossible to use both devices simultaneously.

Can you modify the OLED board and access the CS input?

The photos at the electrodragon link show that they have two versions of the display. One is I2C (four pin) and the other is the SPI. The SPI version has a CS (Chip Select) pin. Using this pin, you should be able to handle the SD and the display. I doubt that the display's CS pin is hardwired to ground - wouldn't make sense :slight_smile:

BTW on SPI, the CS pin selects the device when it is set LOW and de-selects it when it is HIGH.

Pete