Interfacing SD / MMC Card with SPI

Library to easily interface SD cards using the uFAT technique can be found here if you are interested in the development of it or want to request features, go to here.

As for 20090217 allows to easily read/write/append/delete contents from/to files.

Filesystem

SD-Card must be formatted with FAT-16 Filesystem with only a single partition on it.

SD / MMC Pinout

SD

Pinout

 SD ModeSPI Mode
PinNameTypeDescriptionNameTypeDescription
1CD/DAT3I,OCard detection / Data Line 3 (Bit 3)CSIChip Select (Active low)
2CMDI,OCommand/ResponseDataInIHost to Card Commands and Data
3VSS1SSupply Voltage GroundVSS1SSupply Voltage Ground
4VDDSSupply VoltageVDDSSupply Voltage
5CLKIClockCLKIClock
6VSS2SSupply Voltage GroundVSS2SSupply Voltage Ground
7DAT0I,OData Line 0 (Bit 0)DataOutOCard to Host Data and Status
8DAT1I,OData Line 1 (Bit 1)RSV-Reserved
9DAT2I,OData Line 2 (Bit 2)RSV-Reserved

Type: S=power supply; I=input; O=output using push-pull drivers.

MMC

Pinout

 MultiMediaCard ModeSPI Mode
PinNameTypeDescriptionNameTypeDescription
1RSVNCNot connected or Always "1"CSIChip Select (Active low)
2CMDI,O,PP,ODCommand/ResponseDataInIHost-to-card Command and Data
3VSS1SSupply Voltage GroundVSS1SSupply Voltage Ground
4VDDSSupply VoltageVDDSSupply Voltage
5CLKIClockCLKIClock
6VSS2SSupply Voltage GroundVSS2SSupply Voltage Ground
7DAT0I,O,PPData0DataOutOCard-to-host Data and Status

Type: S=power supply; I=input; O=output; PP: push-pull; OD: open-drain; NC: No connection or VIH.

Existing Shields

There are several shields for Arduino that handle the use of SD cards. Here some references on where to find them:

(c) 2008 picture courtesy of Libelium

(more to come...)

Author: illustrations and tables pixel::doc, SDuFAT library BlushingBoy

Share