CTWP009: An Introduction to SD Card Interface
Cactus Technologies
®
4
This white paper is just a simple introduction to the SD Card interface. For more details on the SD
protocol, command set, responses, register descriptions, etc., we highly encouraged the reader to
download the Simplied SD Card Physical Layer Specications from the SD Card Association website
or obtaining the ocial full specication by signing the LAMS agreement available from the SD Card
Association website.
Further Reading
06.0
There are two types of data packet format. One for normal byte wide data and the other for wide
width data which uses a 512 bit data block. Both types of data packets are protected with CRC16.
For normal 512 byte data transfers, the data is transferred least signicant byte rst but in the
individual byte, the data is transmitted MSB rst.
Data transfer can be done in 1-bit mode (using DAT0 only) or 4 -bit mode (if enabled, using DAT0 3).
When using 4 -bit mode, the byte data is formatted such that bit[7:4] are sent on DAT[3:0] followed by
bit[3:0] on DAT[3:0]. There are detailed diagrams of the formatting in the simplied SD Spec. from the
SD Card Association website.
Data Packet
04.2
While most of the SD Card's operation is the same whether in SD mode or SPI mode, there are a few
dierences that need to be pointed out.
SPI Mode Operation
05.0
SPI mode uses only 1 -bit wide data bus width.
SPI transfers are byte oriented; all commands and data transfers consists of a series of bytes.
Two new response tokens are dene for SPI mode.
If the card encounters an error condition during data read, it will respond with an ERROR token
in SPI mode rather than a timeout as in SD mode.
For block writes in SPI mode, the card returns a data response token after receiving each
data block.
For block writes in SPI mode, the data block is preceded with a Start Block Token.
CRC protection is optional for SPI mode. However, the RESET command is issued while the card
is in SD mode, thus, this command must be issued with a valid CRC eld.
Command class 1, 3 and 9 are not supported in SPI mode. The supported commands for a
specic class are also dierent between SPI and SD modes.