SD card module SPI pins

Hello everyone, I'm quite new to arduino and I'm working on a project. In this project, I have to use an LCD Keypadshield and an SD card module at the same time. The problem is that the LCD Keypadshield occupies pins 10 11 12 13 but I have read that I need to use SPI pins for the SD card module and for arduino pins 10, 11, 12, 13 are SPI pins. Is there any way I can use the LCD Keypadshield and SD card module together?

Thank you for your help...

Yes.

SPI supports more than 1 device on the "bus". All devices share the same MOSI (pin 11), MISO (pin 12) & SCK ( pin 13) signals. Each device has a separate SS (Slave Select or Chip Select) signal which you may need to control yourself depending on the functionality provided by the library you are using.

On the Arduino UNO, the pin labelled 10 is usually used as the first SS signal as it stops the micro accidentally becoming an SPI slave device when it is used as an output.

Check the library for the SD card and the LCD to see if they allow you to specify an alternative SS pin. It's usually done as part of the call to begin() for the LCD or SD card.

EDIT: I forgot to add that some SD card modules do not play nice with other devices on the SPI bus because of the way they drive the MISO signal.

markd833:
Yes.

SPI supports more than 1 device on the “bus”. All devices share the same MOSI (pin 11), MISO (pin 12) & SCK ( pin 13) signals. Each device has a separate SS (Slave Select or Chip Select) signal which you may need to control yourself depending on the functionality provided by the library you are using.

On the Arduino UNO, the pin labelled 10 is usually used as the first SS signal as it stops the micro accidentally becoming an SPI slave device when it is used as an output.

Check the library for the SD card and the LCD to see if they allow you to specify an alternative SS pin. It’s usually done as part of the call to begin() for the LCD or SD card.

EDIT: I forgot to add that some SD card modules do not play nice with other devices on the SPI bus because of the way they drive the MISO signal.

First of all thank you for your response. I have been researching the subject since i posted and yes the SD card library allows me to specify an alternative SS pin but for the rest,* i couldn’t find anything so you were really helpfull thank you.*

Based on other Threads I have read there are some SD Card modules that don't play well with the SPI bus - IIRC they don't fully relinquish control when they should.

...R

Robin2:
Based on other Threads I have read there are some SD Card modules that don't play well with the SPI bus - IIRC they don't fully relinquish control when they should.

...R

Guess i will have to try and experience thank you.

Some SD card modules will not play well with other devices on the SPI bus. The problem is with the way the level shifter on the SD module is wired. The ones that do not work well have the MISO signal running through the level shifter. That causes the MISO signal to not be released so that the other devices can control it. The modules made by Adafruit (and some others) have the MISO signal going from the SD card straight to the MISO, bypassing the level shifter. Look at the schematic for the Adafruit module to see what to look for. DO (data out) is the MISO signal.

I have heard the tales about SD cards not mixing well with other SPI devices, but this apears to be an issue that only occurs when using SD card modules on 5V Arduinos ? Not seen the problem myself, I gave up using 5V logic microcontrollers more than 10 years ago.

I often use SD cards directly at 3.3V, just the holder no electronics involved, with SPI devices such as LoRa devices or TFT displays, I dont get a problem.

Yes, srnet, that is right. It is the way that the 5V to 3.3V level shifter is wired.