What are two of the hardware protocols used to communicate with SD cards? Which will most likely work with more microcontrollers?
SD (and microSD) cards support two distinct hardware bus protocols:
-
SD / SDIO native bus mode: the card's own protocol using a dedicated command line plus a data bus that can be 1-bit or 4-bit wide (full-size SDHC/SDXC also define higher-speed UHS modes). This is the high-performance mode and requires either a dedicated SD/MMC host controller peripheral or a carefully bit-banged implementation, and adherence to the licensed SD specification.
-
SPI mode: SD cards also implement a simpler SPI interface using the standard SPI signals (SCLK, MOSI/DI, MISO/DO, CS). It is slower (typically 1-bit, lower clock) but dramatically simpler to drive.
Which works with more microcontrollers: SPI mode. Almost every microcontroller — even very small ones — has an SPI peripheral (or can easily bit-bang SPI), whereas a dedicated SD/SDIO 4-bit host controller is found mainly on larger MCUs/SoCs. SPI mode needs no special host hardware, the protocol is simple, and there are many lightweight FAT filesystem libraries (e.g., FatFs) that drive SD cards over SPI. That ubiquity and simplicity make SPI mode the most portable choice, at the cost of throughput.
