SPI Conflict using an unbuffered µSD Card.

I have an Arduino M0 communicating to both:

  • MAX31855 Thermocouple interface (SPI)
  • SD Card

My issue is with the MISO line. I found my SD Card breakout board with buffer was an older one where the tri state control for the MISO was disabled (grounded).

So I had some small SD Card boards with no buffer and no 5V supply. I wired them to my setup using 3.3V drive and all the appropriate lines. There was still a conflict, when I removed the MISO wire from the SD card, the MAC31855 started to work.

Question: Is the MISO output of a "bare" SD Card tri-stated with the CS line? I downloaded some parts of the SDCARD.org spec but could not find any reference to the hardware details.

I have since, modified the buffered SD Card board and the system looks like it is working.

Thanks
John

"Question: Is the MISO output of a "bare" SD Card tri-stated with the CS line? "

In my designs, I also assume it is not, and use one gate of a part like 74AHC125 to enable MISO when the SD is selected, and keep it off the SPI bus otherwise.

Thanks for the info :slight_smile:

From my experience today, it seems MISO is not tri-state with CS. Although I did not investigate in depth, I did triple check the wiring. And pulling he MISO wire from the SD card allowed the other device on the SPI bus to function.

By definition it is not tri-stated. It has two states either an input or output state. Serial Peripheral Interface (SPI) is a Synchronous interface bus commonly used to send data between microcontrollers and small peripherals such as shift registers, sensors, and SD cards. SPI is a Synchronous transfer - That means that the clock signal accompanies the data signal. MOSI - Master Out Slave In; MISO - Master In Slave Out; SCK - Clock signal from master to slave; SS - Slave Select signal selects slave devices. SPI is a bus and can have multiple devices on the bus. It uses separate clock and data lines, along with a select line to choose the device you wish to talk to. As I see it if the chip is not selected the MISO becomes an input.The diagram shows the data flow when the Slave selected.

Good Luck & Have Fun!
Gil

By definition it is not tri-stated.

If you are referring to the "bare" SD card you are likely correct. However at least some SD Card breakout boards have the MISO of the card output tri stated when the chip is not selected.

. As I see it if the chip is not selected the MISO becomes an input.The diagram shows the data flow when the Slave selected.

I don't agree here. It appears the MISO is an output only. If it were an input then it would not conflict with a currently selected device on the same bus, which unfortunately it does.

John

MISO is an output when it is in slave mode, when in master mode it is an input. Try this link: Serial Peripheral Interface (SPI) - learn.sparkfun.com
This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

Thanks for the follow-up.

when in master mode it is an input

However my issue was with a SD Card which to my knowledge can never be a "Master"

So my statement that the SD Card MISO is always an output and at the card level is never in the tristate condition is correct.