SanDisk miniSD Card Product Manual Version 1.1 Document No. 80-36-00235 November 2003 SanDisk Corporation Corporate Headquarters • 140 Caspian Court • Sunnyvale, CA 94089 Phone (408) 542-0500 • Fax (408) 542-0503 www.sandisk.
SanDisk® Corporation general policy does not recommend the use of its products in life support applications where in a failure or malfunction of the product may directly threaten life or injury. Per SanDisk Terms and Conditions of Sale, the user of SanDisk products in life support applications assumes all risk of such use and indemnifies SanDisk against all damages. See “Limited Warranty” and “Disclaimer of Liability.” This document is for information use only and is subject to change without prior notice.
Table of Contents 1. Introduction to the SanDisk miniSD Card.......................................................................................................... 1-1 1.1. Scope ................................................................................................................................................. 1-2 1.2. Product Models ................................................................................................................................. 1-2 1.3. System Features......
Table of Contents 3.5.8. SD Card Registers in SPI Mode............................................................................................. 3-25 3.6. Data Interchange Format and Card Sizes .......................................................................................... 3-25 4. miniSD Card Protocol Description..................................................................................................................... 4-1 4.1. SD Bus Protocol.........................................
Table of Contents 5.2.3. Responses................................................................................................................................ 5-13 5.2.4. Data Tokens ............................................................................................................................ 5-15 5.2.5. Data Error Token .................................................................................................................... 5-16 5.2.6. Clearing Status Bits.....................
Table of Contents This page intentionally left blank. vi SanDisk miniSD Card Product Manual, Rev. 1.
1. Introduction to the SanDisk miniSD Card The SanDisk miniSD Card is a Secure Digital (SD) card that uses flash-based memory specifically designed to meet the security, capacity, performance and environmental requirements inherent in newly emerging audio and video consumer electronic devices. The SanDisk miniSD Card includes a copyright protection mechanism that complies with the security of the SDMI standard, and is faster and capable of higher memory capacity.
1.1. Scope This document describes the key features and specifications of the miniSD Card, as well as the information required to interface this product to a host system. 1.2. Product Models The SanDisk miniSD Card is available in the capacities shown in Table 1-1. Table 1-1. miniSD Card Capacities Model No. Capacities SDSDM-16 16 MB SDSDM-32 32 MB SDSDM-64 64 MB SDSDM-128 128 MB SDSDM-256 256 MB 1.3.
The performance of the communication channel is described in Table 1-3. Table 1-3. SD Bus/SPI Bus Comparison miniSD Card Using SD Bus miniSD Card Using SPI Bus Six-wire communication channel (clock, command, 4 data lines). Three-wire serial data bus (Clock, dataIn, dataOut) + card specific CS signal (hardwired card selection). Error-protected data transfer. Optional non-protected data transfer mode available. Single or multiple block oriented data transfer.
1.5.2. Defect and Error Management miniSD Cards contain a sophisticated defect and error management system. This system is analogous to the systems found in magnetic disk drives and in many cases offers enhancements. For instance, disk drives do not typically perform a read after write to confirm the data is written correctly because of the performance penalty that would be incurred. SanDisk miniSD cards do a read after write under margin conditions to verify that the data is written correctly.
1.5.6. Using the Erase Command The Erase (sector or group) command provides the capability to substantially increase the write performance of the miniSD Card. Once a sector has been erased using the Erase command, a write to that sector will be much faster. This is because a normal write operation includes a separate sector erase prior to write. 1.5.7. Automatic Sleep Mode A unique feature of the SanDisk miniSD Card (and other SanDisk products) is automatic entrance and exit from sleep mode.
In addition, the miniSD host can read the card’s CID register using the READ_CID SD Card command. The CID register is programmed during the miniSD testing and formatting procedure, on the manufacturing floor. The miniSD host can only read this register and not write to it. An internal pull-up resistor on the DAT3 line may be used for card detection (insertion/removal). The resistor can be disconnected during data transfer (using ACMD42).
mini SD Memory Card WP Group 0 Sector 1 Block 0 Block 1 Block 2 Block n Block 2 Block n Sector 2 Sector 3 Sector n WP Group 1 WP Group n Protected Area (Copyright protection) Sector 1 Block 0 Block 1 Sector n Figure 1-2. Memory Array Partitioning Table 1-5.
Multiple Block Mode Memory Sectors Memory Sectors Memory Sectors Memory Sectors Memory Sectors Memory Sectors Write Read Stop Start Address Memory Sectors Start Address (Read) Memory Sectors Stop Start Single Block Mode Memory Sectors Memory Sectors Misalignment Error Memory Sectors Start Address (Write) Memory Sectors Memory Sectors Memory Sectors Start Address (Read/Write) Figure 1-3.
1.5.9.9. Erase The smallest erasable unit in the miniSD Card is a sector. In order to speed up the erase procedure, multiple sectors can be erased at the same time. To facilitate selection, a first command with the starting address is followed by a second command with the final address, and all sectors within this range will be selected for erase. 1.5.9.10. Write Protection Two-card level write-protection options are available: permanent and temporary.
1.5.10.1. Negotiating Operating Conditions The operating condition negotiation function of the miniSD Card bus is supported differently in SPI mode by using the READ_OCR (CMD58) command. The host shall work within the valid voltage range (2.7 to 3.6 volts) of the card or put the card in inactive state by sending a GO_INACTIVE command to the card. 1.5.10.2. Card Acquisition and Identification The host must know the number of cards currently connected on the bus.
This page intentionally left blank. 1-11 SanDisk miniSD Card Product Manual, Rev. 1.
2. Product Specifications For all the following specifications, values are defined at ambient temperature and nominal supply voltage unless otherwise stated. 2.1. System Environmental Specifications Table 2-1. System Environmental Specifications Temperature Operating: -25° C to 85° C Non-Operating: -40° C to 85° C Humidity Operating: 25% to 95%, non-condensing Non-Operating: 25% to 95%, non-condensing ESD Protection Contact Pads: ± 4kV, Human body model according to ANSI EOS/ESD-S5.
2.3. Typical Card Power Requirements Table 2-5. Card Power Requirements VDD (ripple: max, 60mV peak to peak) 2.7V – 3.6V (Ta = Room) Capacity Value Measurement Notes Sleep All 150 uA Max Read 16, 32 MB 25 mA Typical Read 64, 128, 256 MB 30 mA Typical Write 16, 32 MB 30 mA Typical Write 64, 128, 256 MB 40 mA Typical 2.4. System Performance Table 2-7. System Performance Typical Maximum Block Read Access Time Binary Products MLC Products 1.
2.6. Physical Specifications Refer to Figures 2-1 through 2-5 for miniSD Card physical specifications and dimensions. Figure 2-1. SanDisk miniSD Card Dimensions 2-3 SanDisk miniSD Card Product Manual, Rev. 1.
Figure 2-2. SanDisk miniSD Card Dimensions Figure 2-3. SanDisk miniSD Card Dimensions 2-4 SanDisk miniSD Card Product Manual, Rev. 1.
Figure 2-4. miniSD Card Dimensions Figure 2-5. miniSD Card Dimensions 2-5 SanDisk miniSD Card Product Manual, Rev. 1.
SYMBOL A A1 A2 A3 A4 B B1 B2 B3 B4 B5 B6 B7 B8 C C1 C2 C3 C4 C5 C6 C7 D1 D2 D3 D4 D5 D6 D7 G1 G2 G3 G4 H J2 J3 R1 R2 R3 R4 R5 R6 R7 R9 a e aaa COMMON DIMENSIONS MIN NOM MAX 19.90 20.00 20.10 18.40 18.50 18.60 0.50 0.60 0.70 1.45 2.05 5.75 21.40 21.50 21.60 7.60 7.70 7.80 5.40 5.50 5.60 5.85 6.00 6.15 1.45 1.60 1.75 5.20 0.20 0.30 0.40 0.55 0.65 0.75 0.20 1.30 1.40 1.50 0.80 0.90 1.00 0.55 0.70 0.85 0.30 0.40 0.50 1.10 1.20 1.30 0.00 0.20 1.85 0.00 0.20 17.50 3.40 1.65 1.50 0.80 12.00 6.00 0.75 0.90 1.
This page intentionally left blank. 2-7 SanDisk miniSD Card Product Manual, Rev. 1.
3. miniSD Card Interface Description 3.1. General Description of Pins and Registers The miniSD Card has 11 exposed contacts on one side. The host is connected to the miniSD Card using a dedicated 9-pin connector. 3.1.1. Pin Assignments in mini SD Mode Figure 3-1 lists the pin assignments and definitions in SD bus / SPI Mode. Figure 3-1.
as well, while they are not used. It is defined so, in order to keep compatibility to MultiMediaCards. 3) After power up this line is input with 50KOhm pull-up (can be used for card detection or SPI mode selection). The pull-up should be disconnected by the user, during regular data transfer, with SET_CLR_CARD_DETECT (ACMD42) command 4) NC pins should be left open. 3.1.2. miniSD Card Registers Table 3-2.
Figure 3-2. SD Card Architecture 3.2. SD Bus Topology The SD bus has six communication lines and three supply lines: • • • • • 3-3 CMD—Command is a bi-directional signal. (Host and card drivers are operating in push pull mode.) DAT0-3—Data lines are bi-directional signals. (Host and card drivers are operating in push pull mode.) CLK—Clock is a host to cards signal. (CLK operates in push pull mode.) VDD—VDD is the power supply line for all cards. VSS [1:2]—VSS are two ground lines.
Figure 3-3 shows the bus topology of several cards with one host in SD Bus mode. HOST CLK CLK Vdd Vss Vdd Vss D0-3(A), CMD(A) D0-D3, CMD mini SD Memory mini SD(A) Memory Card Card (A) CLK Vdd Vss D0-3(B), CMD(B) D0-D3, CMD mini SD Memory mini SD(B) Memory Card Card (B) CLK Vdd Vss D0-3(C) CMD(C) D0, CS, CMD MultiMediaCard MultiMediaCard (C) (C) D1&D2 Not Connected Figure 3-3.
R DAT RCMD RWP Write Protect Vss CMD DAT0-3 SD Memory CLK C1 C 2 Card Host C3 9 1 2 3 4 5 6 78 SD Memory Card Figure 3-4. Bus Circuitry Diagram RDAT and RCMD are pull-up resistors protecting the CMD and the DAT line against bus floating when no card is inserted or when all card drivers are in a hi-impedance mode. Hot Insertion/Removal Hot insertion and removal are allowed: the SanDisk miniSD Card will not be damaged by inserting or removing it into the SD bus even when the power is up.
Another SPI common characteristic, which is implemented in the miniSD Card as well, is byte transfers. All data tokens are multiples of 8-bit bytes and always byte aligned to the CS signal. The SPI standard defines the physical link only and not the complete data transfer protocol. In SPI Bus mode, the miniSD Card uses a subset of the miniSD Card protocol and command set. The miniSD Card identification and addressing algorithms are replaced by the hardware Chip Select (CS) signal.
3.4. Electrical Interface The following sections provide valuable information for the electrical interface. 3.4.1. Power-up The power up of the SD Card bus is handled locally in each miniSD Card and in the bus master. Logic working level Supply voltage VDD max Valid voltage range for commands CMD0, 15, 55, and ACMD41 Bus master supply voltage Valid voltage range for all other commands and memory access.
After power up, the host starts the clock and sends the initializing sequence on the CMD line. This sequence is a contiguous stream of logical ‘1’s. The sequence length is the maximum of 1msec, 74 clocks or the supply-ramp-uptime; the additional 10 clocks (over the 64 clocks after what the card should be ready for communication) is provided to eliminate power-up synchronization problems. Every bus master shall have the capability to implement ACMD41 and CMD1.
Table 3-4. Signal Line’s Load Parameter Pull-up resistance Symbol Min. Max. Unit Remark RCMD RDAT 10 100 kΩ To prevent bus floating Bus signal line capacitance CL 250 pF fPP ≤ 5 MHz, 21 cards Bus signal line capacitance CL 100 pF fPP ≤ 20 MHz, 7 cards CCARD 10 pF 16 nH fPP ≤ 20 MHz 90 kΩ May be used for card detection Single card capacitance Maximum signal line inductance Pull-up resistance inside card (pin 1) RDAT3 10 3.4.4.
3.4.5. Bus Timing fPP 0.7 tWL tWH 0.2 Clock VIH tTLH tTHL tISU VIL tIH VIH Input VIL VOH Output VOL tO DLY tO DLY (max) (min) Shaded areas are not valid. Figure 3-8. Timing Diagram Data Input/Output Referenced to Clock Table 3-6. Bus Timing Parameter Symbol Min. Max. Unit Remark Clock CLK (All values are referred to min. (VIH) and max.
Parameter Input hold time Symbol Min. tIH 5 Max. Unit Remark ns CL ≤ 25 pF (1 card) Outputs CMD, DAT (referenced to CLK) NOTE: Output delay time during Data Transfer Mode tODLY 0 14 ns CL ≤ 25 pF (1 card) Output delay time during Identification Mode tODLY 0 50 ns CL ≤ 25 pF (1 card) OHz stops the clock. The given minimum frequency range is for cases where a continuous clock is required. 3.5. miniSD Card Registers There is a set of seven registers within the card interface.
OCR Bit VDD Voltage Window 21 3.3-3.4 22 3.4-3.5 23 3.5-3.6 24-30 reserved 31 Card power up status bit (busy) The level coding of the OCR register is as follows: • • Restricted voltage windows=LOW Card busy=LOW (bit 31) The least significant 31 bits are constant and will be set as described in Figure 3-9. If bit 32 (the busy bit) is set, it informs the host that the card power up procedure is finished. 24 16 6 FF 00 8 7 80 4 3 0 0 0 Reserve Operatin Voltage 2.7 – 3.
Name Type Width CID—Slice Comments CID Value Not used, always ‘1’ 1 [0:0] * 3C = The 3 SDA founding companies: Toshiba, SanDisk, and MEI. ** The product revision is composed of two Binary Coded Decimal (BCD) digits, four bits each, representing an “n.m” revision number. The “n” is the most significant nibble and the “m” is the least significant nibble. Example: The PRV binary value filed for product revision “6.2” will be: 0110 0010.
Name Field Width Cell CSD-Slice Type CSD Value CSD Code SD064=45 mA SD032=35 mA SD016=35 mA SD064=101b SD032=100b SD016=100b Max. Write current @VDD min VDD_W_CURR_MIN 3 R [55:53] SD256=35 mA SD128=35 mA SD064=35 mA SD032=25 mA SD016=25 mA SD256=101b SD128=101b SD064=101b SD032=100b SD016=100b Max.
Table 3-10. CSD Register Structure CSD_STRUCTURE 0 1-3 3-15 CSD Structure Version CSD version No. 1.0 Valid for miniSD Card Physical Specification Version Version 1.0-1.01 Reserved SanDisk miniSD Card Product Manual, Rev. 1.
TAAC—Defines the asynchronous part (relative to the miniSD Card clock (CLK)) of the read access time. Table 3-11. TAAC Access Time Definition TAAC Bit Position Code 2:0 time unit 0=1ns, 1=10ns, 2=100ns, 3=1µs, 4=10µs, 5=100µs, 6=1ms, 7=10ms 6:3 time value 0=reserved, 1=1.0, 2=1.2, 3=1.3, 4=1.5, 5=2.0, 6=2.5, 7=3.0, 8=3.5, 9=4.0, A=4.5, B=5.0, C=5.5, D=6.0, E=7.0, F=8.0 7 Reserved NSAC—Defines the worst case for the clock dependent factor of the data access time.
READ_BL_LEN—The maximum read data block length is computed as 2READ_BL_LEN. The maximum block length might therefore be in the range 512...2048 bytes. Note that in the miniSD Card, the WRITE_BL_LEN is always equal to READ_BL_LEN. Table 3-14. Data Block Length READ_BL_LEN Block Length 0-8 Reserved 9 29 = 512 Bytes ...... 11 211 = 2048 Bytes 12-15 Reserved READ_BL_PARTIAL— READ_BL_PARTIAL is always set to 1 in the miniSD Card. Partial Block Read is always allowed in the miniSD Card.
C_SIZE (Device Size)—This parameter is used to compute the card capacity (does not include security protected area). The memory capacity of the card is computed from the entries C_SIZE, C_SIZE_MULT and READ_BL_LEN as follows: memory capacity = BLOCKNR * BLOCK_LEN Where: BLOCKNR = (C_SIZE+1) * MULT MULT = 2C_SIZE_MULT+2 (C_SIZE_MULT < 8) BLOCK_LEN = 2READ_BL_LEN (READ_BL_LEN < 12) Therefore, the maximum capacity that can be coded is 4096*512*2048 = 4 GB.
ERASE_BLK_EN—defines whether erase of one write block (see WRITE_BL_LEN) is allowed (other than SECTOR_SIZE given below). If ERASE_BLK_EN is 0, the host can erase a unit of SECTOR_SIZE. If ERASE_BLK_EN is 1, the host can erase either a unit of SECTOR_SIZE or a unit of WRITE_BLK_LEN. SECTOR_SIZE—The size of an erasable sector. The content of this register is a 7-bit binary coded value, defining the number of write blocks (see WRITE_BL_LEN). The actual size is computed by increasing this number by one.
COPY—This bit marks the card as an original (‘0’) or non-original (‘1’). Once set to non-original, this bit cannot be reset to original. The definition of “original” and “non-original” is application dependent and changes no card characteristics. PERM_WRITE_PROTECT—Permanently protects the whole card content, except the secured protected area, against overwriting or erasing (all write and erase commands for this card are permanently disabled). The default value is ‘0’, i.e., not permanently write protected.
Table 3-23. SCR Register Structure Version CSD_STRUCTURE CSD Structure Version 0 SCR version No. 1.0 1-15 Valid for SD Physical Layer Specification Version Version 1.0-1.01 Reserved SD_SPEC—Describes the miniSD Card Physical Layer Specification version supported by this card. Table 3-24. mini SD Physical Layer Specification Version SPEC_VERS 0 Physical Layer Specification Version Number Version 1.0-1.
3.5.5. Status Register The miniSD Card supports the following two card status fields: • • Card Status—This status field is compatible to the MultiMediaCard protocol. SD_Status—This extended status field of 512 bits supports special features unique to the miniSD Card and future application specific features. The miniSD Card status registers’ structures are defined in Table 3-27. The Type and Clear-Condition fields in the table are coded as follows: Type: • • • • E—Error bit. S—Status bit.
Bits Identifier Type Value Description Clear Cond. correct the data. 20 CC_ERROR ERX ’0’= no error ’1’= error Internal card controller error C 19 ERROR ERX ’0’= no error ’1’= error A general or an unknown error occurred during the operation.
3.5.6. SD Status The SD Status contains status bits that are related to the miniSD Card proprietary features and may be used for future application specific usage. The size of the SD Status is one data block of 512 bits. The content of this register is transmitted to the Host over the DAT bus along with 16 bits CRC. The SD Status is sent to the host over the DAT bus if ACMD13 is sent (CMD55 followed with CMD13). ACMD13 can be sent to a card only in “tran_state” (card selected).
3.5.8. SD Card Registers in SPI Mode In SPI mode, all the card’s registers are accessible. Their format is identical to the format in the miniSD mode. However, a few fields are irrelevant in SPI mode. In SPI mode, the card status register has a different, shorter, format as well. Refer to the SPI Protocol section for more details. 3.6. Data Interchange Format and Card Sizes In general, the miniSD Card data is structured by means of a file system.
This page intentionally left blank. 3-26 SanDisk miniSD Card Product Manual, Rev. 1.
4. miniSD Card Protocol Description 4.1. SD Bus Protocol Communication over the SD bus is based on command and data bit streams, which are initiated by a start bit and terminated, by a stop bit: • • • Command—A command is a token that starts an operation. A command is sent from the host either to a single card (addressed command) or to all connected cards (broadcast command). A command is transferred serially on the CMD line.
From host to card(s) From card to host Command CMD Stop command stops data transfer Data from card to host Command Response DAT Data block crc Data block crc Data block Response crc Data stop operation Block read operation Multiple block read operation Figure 4-2. Multiple Block Read Operation The block-write operation uses a simple busy signaling of the write operation duration on the DAT0 data line (see Figure 4-3) regardless of the number of data lines used for transferring the data.
Each command token is preceded by a start bit (0) and succeeded by an end bit (1). The total length is 48 bits. CRC bits protect each token so that transmission errors can be detected and the operation may be repeated. Response tokens have four coding schemes depending on their content. The token length is either 48 or 136 bits. The CRC protection algorithm for block data is a 16-bit CCITT polynomial. All used CRC types are described in Section 4.6.
MSB (4095) LSB (0) End bt: always '1' Start bit always '0' Standard busy (only DAT0 used): 0 CRC 1 Block length MSN LSN End bt: always '1' Start bit always '0' Wide bus (all four data lines used): DAT3 0 4095 3 CRC 1 DAT2 0 4094 2 CRC 1 DAT1 0 4093 1 CRC 1 DAT0 0 4092 0 CRC 1 Block length /4 Figure 4-6. Data Packet Format 4.2. Protocol’s Functional Description All communication between the host and miniSD Cards is controlled by the host (master).
SanDisk miniSD cards have two operation modes. • • Card Identification Mode—The host will be in card identification mode after reset and while it is looking for new cards on the bus. miniSD Card s will be in this mode after reset until the SEND_RCA command (CMD3) is received. Data Transfer Mode— miniSD Cards will enter data transfer mode once their RCA is first published. The host will enter data transfer mode after identifying all of the miniSD Cards on the bus.
Power On SPI Operation Mode CMD0 CS Asserted ("0") Card is Busy or Host ommitted voltage range Idle State (idle) CMD0 ACMD41 Inactive State (ina) No response (non-valid command) Must be an MMC Ready State (ready) Start MMC initialization process starting at CMD1 From all states except (ina) CMD15 Cards with non-compatible voltage range CMD2 Identification State (ident) Card Identification Mode Data Transfer Mode CMD3 Card responds with new RCA Stand-by State (stby) CMD3 Card responds with
4.3.2. Operating Voltage Range Validation The SD Physical Specification standard requires that all miniSD cards will be able to establish communication with the host using any operating voltage between VDD-min and VDD-max. However, during data transfer, minimum and maximum values for VDD are defined in the operation condition register (OCR) and may not cover the whole range. miniSD Card hosts are expected to read the card’s OCR register and select proper VDD values or reject the card.
4.3.3. Card Identification Process The host starts the card identification process with the identification clock rate fOD (see Section 3.4.4). In miniSD Card the CMD line output drives are push-pull drivers. After the bus is activated, the host will request the cards to send their valid operation conditions (ACMD41 preceding with APP_CMD—CMD55 with RCA=0x0000). The response to ACMD41 is the operation condition register of the card. The same command shall be send to all of the new cards in the system.
Card Identification mode CMD3 CMD15 CMD0 Sending-data state (data) Data-transfer mode From all states in data-transfer mode CMD13, CMD55 CMD12 "operation complete" No state transition in data-transfer mode CMD17, 18, 30, 56(r) ACMD51 CMD7 Stand-by state (stby) CMD7 CMD4, 9, 10 "Operation complete" Disconnect state (dis) CMD28, 29, 38 "Operation complete" Transfer state (tran) CMD 16, 32...
The relationship between the various data transfer modes is summarized in Figure 4-8, and in the following paragraphs: • • • • • • • • • • • All data read commands may be aborted any time by the stop command (CMD12). The data transfer will terminate and the card will return to the Transfer State. The read commands are: block read (CMD17), multiple block read (CMD18), send write protect (CMD30), send scr (ACMD51) and general command in read mode (CMD56).
The payload for block-oriented data transfer is preserved by a CRC check sum. The generator polynomial is a standard CCITT polynomial: x16+x12+x5+1 The code is a shortened BCH code with d=4 and is used for payload length of up to 2048 Bytes. Note that the CRC check sum is calculated and attached to each DAT line at the end of the block. In the case of a wide bus operation (DAT0-DAT3), the 16-bit CRC is calculated separately for each DAT line. Block Read A block read is a block-oriented data transfer.
After receiving a block of data and completing the CRC check, the card will begin writing and hold the DAT0 line low if its write buffer is full and unable to accept new data from a new WRITE_BLOCK command. The host may poll the status of the card with a SEND_STATUS command (CMD13) at any time, and the card will respond with its status. The status bit READY_FOR_DATA indicates whether the card can accept new data or whether the write process is still in progress.
As described above for block write, the card will indicate that an erase is in progress by holding DAT0 low. The actual erase time may be quite long, and the host may issue CMD7 to deselect the card or perform card disconnection, as described in the Block Write section, above. The data at the card after an erase operation is either ‘0’ or ‘1’, depending on the card vendor. The SCR register bit DATA_STAT_AFTER_ERASE (bit 55) defines whether it is ‘0’ or ‘1’. 4.4.4.
The only effect of the APP_CMD is that if the command index of the immediately following command has an ACMD overloading it, the non standard version will be used. For example, a card has a definition for ACMD13 but not for ACMD7. Therefore, if Command 13 is received immediately after APP_CMD command, it would be interpreted as the non standard ACMD13, whereas command 7, similarly received, would be interpreted as the standard CMD7.
100KHz-400KHz Clocks 1) CLK 1st CMD 2nd 3rd (ACMD41) Polling less than 50ms interval 2) CLK <50ms CMD <50ms 2nd 1st 3rd (ACMD41) Figure 4-9. Host Procedures Waiting for Card to be Ready • • It is an obvious requirement that the clock must be running for the miniSD Card to output data or response tokens. After the last miniSD Card bus transaction, the host is required to provide eight clock cycles for the card to complete the operation before shutting down the clock.
Figure 4-10. CRC7 Generator/Checker CRC16 When one DAT line is used (as in the MultiMediaCard), the CRC16 is used for payload protection in block transfer mode. The CRC check sum is a 16-bit value and is computed as follows: generator polynomial G(x) = x16 + x12 +x5 +1 M(x) = (first bit) * xn + (second bit)* xn-1 +...+ (last bit) * x0 CRC[15...0] = Remainder [(M(x) * x16 ) / G(x)] The first bit is the first data bit of the corresponding block.
4.7. Error Conditions The following sections provide valuable information on error conditions. 4.7.1. CRC and Illegal Command CRC bits protect all commands. If the addressed miniSD Card’s CRC check fails, the card does not respond and the command is not executed. The miniSD Card does not change its state, and COM_CRC_ERROR bit is set in the status register.
4.8. Commands The following sections provide valuable information on commands. 4.8.1. Command Types There are four kinds of commands defined to control the miniSD Card: • • • • Broadcast Commands (bc), no response—The broadcast feature is applicable only if all the CMD lines are connected together in the host. If they are separated then each card will accept it separately on his turn. Broadcast Commands with Response (bcr)—response from all cards simultaneously.
Table 4-3.
4.8.4. Detailed Command Description Tables 4-3 through 4-9 define in detail the miniSD Card bus commands. Table 4-5. Basic Commands and Stream Read Commands (Class 0 And Class 1) Cmd Index Type Argument Resp Abbreviation CMD0 bc [31:0] don’t care* - GO_IDLE_STATE CMD1 Resets all cards to Idle State.
CMD17 adtc [31:0] data address R1 READ_SINGLE_ BLOCK CMD18 adtc [31:0] data address R1 READ_MULTIPLE_BLOCK CMD19 – CMD23 Reads a block of the size selected by the SET_BLOCKLEN command.2 Continuously send blocks of data until interrupted by a stop transmission command. Reserved Table 4-9. Block Write Commands (Class 4) Cmd Index Type Argument Resp Abbreviation CMD24 adtc [31:0] data address R1 WRITE_BLOCK Writes a block of the size selected by the SET_BLOCKLEN command.
Table 4-13. Erase Commands (Class 5) Cmd Index Type Argument Resp Abbreviation CMD32 ac [31:0] data address R1 ERASE_WR_BLK_START Sets the address of the first write block to be erased. CMD33 ac [31:0] data address R1 ERASE_WR_BLK_END Sets the address of the last write block of the continuous range to be erased. Reserved CMD34 … CMD37 CMD38 Command Description ac [31:0] don’t care* R1b CMD39 … CMD41 * The bit places must be filled but the value is irrelevant.
Table 4-19 describes all the application specific commands supported/reserved by the miniSD Card. All the following ACMDs shall be preceded with APP_CMD command (CMD55). Table 4-19. Application Specific Commands Used/Reserved by miniSD Card ACMD INDEX Type Argument Resp. Abbreviation Command Description ACMD6 ac [31:2] stuff bits [1:0]bus width R1 SET_BUS_WIDTH Defines the data bus width (’00’=1bit or ’10’=4 bits bus) to be used for data transfer.
4.9. Card State Transition Table Table 4-21 defines the miniSD Card state transitions in dependency of the received command. Table 4-21.
Current State idle ready ident stby tran data rcv prg dis ina CMD33 - - - - tran - - - - - CMD38 - - - - prg - - - - - Class 7 CMD42 This is an SDA optional command supported by the SanDisk miniSD Card.
There are four types of responses that are supported in the SanDisk miniSD Card. Their formats are defined as follows: R1 (standard response): response length 48 bit. Bits 45:40 indicate the index of the command to which it is responding. The status of the card is coded in 32 bits. Note that when a data transfer to the card is involved, a busy signal may appear on the data line after the transmission of each block of data. The host will check for busy after the data block transmission. Table 4-23.
R4 and R5: responses are not supported. R6 (Published RCA response): code length 48-bit. The bits 45:40 indicate the index of the command to be responded to—in that case it will be ‘000011’ (together with bit 5 in the status bits it means = CMD3). The 16 MSB bits of the argument field are used for the published RCA number. Table 4-29.
4.11.1. Command and Response Both host command and card responses are clocked out with the rising edge of the host clock. Card identification and card operation conditions timing The timing for CMD2 and ACMD41 is given bellow. The command is followed by a period of two Z bits (allowing time for direction switching on the bus) and then by P bits pushed up by the responding card. The card response to the host command starts after NID clock cycles.
4.11.2. Data Read Note that the DAT line represents the data bus (either 1 or 4 bits). Single Block Read The host selects one card for data read operation by CMD7, and sets the valid block length for block oriented data transfer by CMD16. The basic bus timing for a read operation is given in Figure 5-17. The sequence starts with a single block read command (CMD17) which specifies the start address in the argument field. The response is sent on the CMD line as usual.
The data is suffixed with CRC check bits to allow the card to check it for transmission errors. The card sends back the CRC check result as a CRC status token on the DAT0 line. In the case of transmission error the card sends a negative CRC status (‘101’). In the case of non-erroneous transmission the card sends a positive CRC status (‘010’) and starts the data programming procedure. When a flash programming error occurs the card will ignore all further data blocks.
The card will treat a data block as successfully received and ready for programming only if the CRC data of the block was validated and the CRC status token sent back to the host. Figure 4-23 is an example of an interrupted (by a host stop command) attempt to transmit the CRC status block. The sequence is identical to all other stop transmission examples. The end bit of the host command is followed, on the data line, with one more data bit, end bit and two Z clock for switching the bus direction.
4.11.4. Timing Values Table 4-33 defines all timing values. Table 4-33. Timing Values Min. Max. Unit NCR 2 64 Clock Cycles NID 5 5 Clock Cycles NAC 2 See note. Clock Cycles NRC 8 - Clock Cycles NCC 8 - Clock Cycles NWR 2 - Clock Cycles NOTE: MIN [([TAAC ∗ f + NSAC ∗ 100] ∗ 100), (100ms ∗ f)]. 4-32 SanDisk miniSD Card Product Manual, Rev. 1.
5. SPI Protocol Definition 5.1. SPI Bus Protocol While the miniSD Card channel is based on command and data bit-streams, which are initiated by a start bit and terminated by a stop bit, the SPI channel is byte oriented. Every command or data block is built of eight bit bytes and is byte aligned (multiples of eight clocks) to the CS signal. Similar to the SD Bus protocol, the SPI messages are built from command, response and data-block tokens.
5.1.2. Bus Transfer Protection CRC bits protect every miniSD Card token transferred on the bus. In SPI mode, the miniSD Card offers a non protected mode which enables systems built with reliable data links to exclude the hardware or firmware required for implementing the CRC generation and verification functions.
Next Command From Host to Card Data Error Token from Card to Host From Card to Host DataIn Command Command Response DataOut Data Error Figure 5-2. Read Operation—Data Error In the case of a Multiple Block Read operation, every transferred block has a 16-bit CRC suffix. The Stop Transmission command (CMD12) will actually stop the data transfer operation (the same as in SD Bus mode).
Every data block has a prefix or ‘start block’ token (one byte). After a data block is received the card will respond with a data-response token, and if the data block is received with no errors, it will be programmed. As long as the card is busy programming, a continuous stream of busy tokens will be sent to the host (effectively holding the dataOut line low). Once the programming operation is completed, the host must check the results of the programming using the SEND_STATUS command (CMD13).
From Host to Card From Host to Card From Card to Host DataIn Command DataOut From Card to Host Command Response Response Busy Figure 5-6. “No Data” Operations 5.1.6. Read CID/CSD Registers Unlike the SD Bus protocol (where the register contents are sent as a command response), reading the contents of the CSD and CID registers in SPI mode is a simple read-block transaction. The card will respond with a standard response token followed by a data block of 16 bytes suffixed with a 16-bit CRC.
There are a few restrictions the SPI host must follow: • • • The bus frequency can be changed at any time (under the restrictions of maximum data transfer frequency, defined by the miniSD Cards). It is an obvious requirement that the clock must be running for the miniSD Card to output data or response tokens. After the last SPI bus transaction, the host is required to provide 8 (eight) clock cycles for the card to complete the operation before shutting down the clock.
Read The read access time is defined as the sum of the two times given by the CSD parameters TAAC and NSAC. These card parameters define the typical delay between the end bit of the read command and the start bit of the data block. Write The R2W_FACTOR field in the CSD is used to calculate the typical block program time obtained by multiplying the read access time by this factor. It applies to all write/erase commands (e.g., SET (CLEAR)_WRITE_PROTECT, PROGRAM_CSD (CID) and the block write commands).
5.2.2. Command Classes As in SD mode, the SPI commands are divided into several classes (See Table 5-1). Each class supports a set of card functions. A miniSD Card will support the same set of optional command classes in both communication modes (there is only one command class table in the CSD register). The available command classes, and the supported commands for a specific class, however, are different in the miniSD Card and the SPI communication mode.
Table 5-3 lists all miniSD Card commands. A “yes” in the SPI mode column indicates that the command is supported in SPI mode. With these restrictions, the command class description in the CSD is still valid. If a command does not require an argument, the value of this field should be set to zero. The reserved commands are reserved in miniSD Card mode as well. The binary code of a command is defined by the mnemonic symbol.
Table 5-3. Description of SPI Bus Commands CMD INDEX SPI Mode Argument Resp Abbreviation CMD0 Yes None R1 GO_IDLE_STATE Resets the miniSD Card CMD1 Yes None R1 SEND_OP_COND Activates the card’s initialization process. CMD2 No CMD3 No CMD4 No CMD5 Reserved CMD6 Reserved CMD7 Command Description No CMD8 Reserved CMD9 Yes None R1 SEND_CSD Asks the selected card to send its card-specific data (CSD).
CMD INDEX SPI Mode Argument Resp Abbreviation Command Description CMD25 Yes [31:0] data address R1 WRITE_MULTIPLE_BLOCK Continuously writes blocks of data until a stop transmission token is sent (instead of ‘start block’). CMD26 No CMD27 Yes None R1 PROGRAM_CSD Programming of the programmable bits of the CSD. CMD281 Yes [31:0] data address R1b SET_WRITE_PROT If the card has write protection features, this command sets the write protection bit of the addressed group.
Table 5-5 describes all the application specific commands supported or reserved by the miniSD Card. All the following commands should be preceded with APP_CMD (CMD55). Table 5-5. Application Specific Commands Used or Reserved by the miniSD Card –SPI Mode CMD INDEX SPI Mode ACMD6 No ACMD13 Yes Argument Resp Abbreviation [31:0] stuff bits R2 SD_STATUS ACMD17 ACMD18 Command Description Send the mini SD status.
5.2.3. Responses There are several types of response tokens. As in the miniSD mode, all are transmitted MSB first. 5.2.3.1. Format R1 This response token is sent by the card after every command with the exception of SEND_STATUS commands. It is 1 byte long, the MSB is always set to zero and the other bits are error indications. A “1” signals error. • • • • • • • In idle state—The card is in idle state and running initializing process.
5.2.3.3. Format R2 The card sends the 2-byte-long response token a response to the SEND_STATUS command. The format of the R2 status is shown in Figure 5-8. 7 Byte 1 0 7 Byte 2 0 0 Card is Locked WP Erase Skip, Lock/Unlock Cmd Failed Error CC Error Card ECC Failed WP Violation Erase Param Out of Range, CSD_Overwrite In Idle State Erase Reset Illegal Command Com CRC Error Erase Sequence Error Address Error Parameter Error Figure 5-8. R2 Response Format The first byte is identical to response R1.
5.2.3.5. Data Response Every data block written to the card is acknowledged by a data response token. It is one byte long and has the following format: 7 6 x x x 0 0 Status 1 The meaning of the status bits is defined as follows: • • • ‘010’—Data accepted. ‘101’—Data rejected due to a CRC error. ’110’—Data Rejected due to a Write Error In case of any error (CRC or Write Error) during Write Multiple Block operation, the host shall stop the data transmission using CMD12.
5.2.5. Data Error Token If a read operation fails and the card cannot provide the required data it will send a data error token, instead. This token is one byte long and has the format shown in Figure 5-10. 7 0 0 0 0 Error CC Error Card ECC Failed Out of Range Card is Locked Figure 5-10. Data Error Token The four least significant bits (LSB) are the same error bits as in response format R2. 5.2.6.
5.4.1. Command/Response Host Command to Card Response−Card is Ready CS H H L L L ******************* <-NCS-> *************** DataIN X X H H H H 6 Bytes Command H H H H H <-NCR-> 1 or 2 Bytes Response DataOut Z Z Z H H H H * * * * * * * * H H H H H L L L L H H H <-NEC-> H H H H X X X H H H H H Z Z Figure 5-11.
The following table describes Stop transmission operation in case of Multiple Block Read. CS DataIN L L L L <- NCS -> X H H H H ******************** Stop Tran command Data Transfer to host DataOut H H H H H * * * * ** * * * <- NCR -> H H Card Response H <2clk> Figure 5-15. Multiple Block Read Timing Reading the CSD Register The following timing diagram describes the SEND_CSD command bus transaction. The timeout values for the response and the data block are NCR (Since the NAC is still unknown).
5.4.4. Timing Values Table 5-9 shows the timing values and definitions. Table 5-9. Timing Constants Definitions Min Max Unit NCS 0 - 8 Clock Cycles NCR 0 8 8 Clock Cycles NRC 1 - 8 Clock Cycles NAC 1 See Note 8 Clock Cycles NWR 1 - 8 Clock Cycles NEC 0 - 8 Clock Cycles NDS 0 - 8 Clock Cycles NBR 0 1 8 Clock Cycles NOTE: MIN [((TAAC ∗ f + NSAC ∗ 100) ∗ 100/8, (100MS * f/8))]. 5.5.
This page intentionally left blank. 5-20 SanDisk miniSD Card Product Manual, Rev. 1.
Appendix A. Ordering Information To order SanDisk products directly from SanDisk, call 408-542-0595. miniSD Card SDSDM-16 SDSDM-32 SDSDM-64 SDSDM-128 SDSDM-256 16 MB 32 MB 64 MB 128 MB 256 MB SanDisk SD Card Product Manual, Rev. 1.
Ordering Information This page intentionally left blank. A-2 SanDisk miniSD Card Product Manual, Rev. 1.
Appendix B. Technical Support Services Direct SanDisk Technical Support Call SanDisk Applications Engineering at 408-542-0405 for technical support. SanDisk Worldwide Web Site Internet users can obtain technical support and product information along with SanDisk news and much more from the SanDisk Worldwide Web Site, 24 hours a day, seven days a week. The SanDisk Worldwide Web Site is frequently updated. Visit this site often to obtain the most up-to-date information on SanDisk products and applications.
Technical Support Services This page intentionally left blank. B-2 SanDisk miniSD Card Product Manual, 1.
Appendix C. SanDisk Worldwide Sales Offices To order SanDisk products directly from SanDisk, call 408-542-0595. SanDisk Corporate Headquarters International Industrial/OEM Sales Offices 140 Caspian Court Sunnyvale, CA 94089 Tel: 408-542-0500 Fax: 408-542-0503 http://www.sandisk.com Europe SanDisk GmbH Karlsruher Str. 2C D-30519 Hannover, Germany Tel: 49-511-875-9131 Fax: 49-511-875-9187 U.S.
SanDisk Worldwide Sales Offices This page intentionally left blank. C-2 SanDisk miniSD Card Product Manual, Rev. 1.
Appendix D. Limited Warranty I. WARRANTY STATEMENT SanDisk warrants its products to be free of any defects in materials or workmanship that would prevent them from functioning properly for one year from the date of purchase. This express warranty is extended by SanDisk Corporation to its customers. II. GENERAL PROVISIONS This warranty sets forth the full extent of SanDisk’s responsibilities regarding the SanDisk miniSD Card.
Limited Warranty IV. RECEIVING WARRANTY SERVICE According to SanDisk’s warranty procedure, defective product should be returned only with prior authorization from SanDisk Corporation. Please contact SanDisk’s Customer Service department at 408-542-0595 with the following information: product model number and description, nature of defect, conditions of use, proof of purchase and purchase date. If approved, SanDisk will issue a Return Material Authorization or Product Repair Authorization number.
Limited Warranty This page intentionally left blank. D-3 SanDisk miniSD Card Product Manual, Rev. 1.
Appendix E. Disclaimer of Liability SanDisk Corporation general policy does not recommend the use of its products in life support applications wherein a failure or malfunction of the product may directly threaten life or injury. Accordingly, in any use of products in life support systems or other applications where failure could cause damage, injury or loss of life, the products should only be incorporated in systems designed with appropriate redundancy, fault tolerant or back-up features.