Electronic – SD Card Pin State During Hot Insertion

microcontrollersdspi

I'm working on a project in which I'm forced to connect an SD card to a shared SPI bus with some other peripherals. I need to make sure a hot insertion event won't corrupt any ongoing data transfer on the bus, but I can't find any information on the power-up state of the card drivers in the simplified specifications. Does anyone know if the CLK, CMD, and DAT0 pins on an SD card are guaranteed to be high-impedance during a hot insertion?

Best Answer

Hot insertion on a shared SPI bus won't work at all with SD cards. One must remember that SD cards come up in SD mode, where the CS is active high.

You need to explicity switch the card to SPI mode before you can use other devices on the same SPI bus, this is obviously not possible when you insert a card during another SPI transaction.

Either use a bus driver chip to connect the SD card or use a different SPI bus, for example software SPI using GPIOs.

Related Topic