This application note explains how to interface an SD card via the SPI bus of the ADuCM3027/ADuCM3029 microcontroller.
The note introduces Secure Digital (SD) cards, their types, capacities, and pin interfaces, and describes how the ADuCM3027/ADuCM3029 processor can communicate with them using the SPI bus. It covers both hardware connections (evaluation board, Arduino‑compatible shield, and optional voltage translator) and software requirements (IAR Embedded Workbench, FatFs library).
Detailed sections show the SPI peripheral configuration, GPIO chip‑select setup, pin‑multiplexing, and sample code for reading and writing data. The document also provides the SPI command set for SD cards, FAT file‑system basics, and references to the processor’s hardware reference manual.
| SPI initialization bit rate | 100 kHz – 400 kHz |
|---|---|
| Maximum SPI bit rate after init | up to 20 MHz |
| Voltage level compatibility | 3.3 V (same as SD card) |
| Chip‑select pin for SD card | GPIO Pin P2_01 |
The design uses GPIO Pin P2_01 as the chip‑select signal instead of the dedicated SPI chip‑select lines.
Supported types are Standard Capacity (SDSC) 1 MB–2 GB, High Capacity (SDHC) 2 GB–32 GB, and eXtended Capacity (SDXC) 32 GB and larger.
The FatFs library R0.12a by ChaN is used to handle FAT file‑system calls.