10.07.2015 Views

SanDisk SD Card

SanDisk SD Card

SanDisk SD Card

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Revision 2.2Chapter 5 – SPI Protocol<strong>SD</strong> <strong>Card</strong> Product Manual5.17 SPI Command SetThe following sections provide valuable information on the SPI Command Set.5.17.1 Command FormatAll <strong>SD</strong> <strong>Card</strong> commands are six bytes long and transmitted MSB first.Byte 1 Byte 2-5 Byte 67 6 5 0 31 0 7 00 1 Command Command Argument CRC 1Commands and arguments are listed in Table 5-2.7-bit CRC Calculation: G(x) = x 7 + x 3 + 1M(x) = (start bit)*x 39 + (host bit)*x 38 +...+ (last bit before CRC)*x 0CRC[6...0] = Remainder[(M(x)*x 7 )/G(x)]5.17.2 Command ClassesAs in <strong>SD</strong> mode, the SPI commands are divided into several classes (See Table 5-1). Eachclass supports a set of card functions. A <strong>SD</strong> <strong>Card</strong> will support the same set of optionalcommand classes in both communication modes (there is only one command class table inthe C<strong>SD</strong> register). The available command classes, and the supported commands for aspecific class, however, are different in the <strong>SD</strong> Memory <strong>Card</strong> and the SPI communicationmode.Note that except the classes that are not supported in SPI mode (class 1, 3 and 9), themandatory required classes for the <strong>SD</strong> mode are the same for the SPI mode.Table 5-1 Command Classes in SPI ModeCCC 0 1 6 9 10 12 13 16 17 18 24 25 27 28 29 30 32 33 34 35 36 37 38 42 50 52 53 55 56 57 58 590 Basic + + + + + + + +1 NS2 Block read + + +3 NS4 Block write + + + +5 Erase + + +6 Writeprotect+ + +7 Lock card + +8 Appspecific+ +9 I/O mode + +10 Switch + + + + + + +11 RKey:NS = Not supported in SPI mode.R = Reserved© 2004 <strong>SanDisk</strong> Corporation 5-8 12/08/04

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!