Bus Transfer Protection Data Read

Revision 1.0 MultiMediaCardRS-MultiMediaCard Product Manual © 2004 SanDisk Corporation 5-4 051304 CS signal low, the module will switch to SPI mode and respond with the SPI mode R1 response. The only way to return to MultiMediaCard mode is by a power cycle turning the power off and on. In SPI mode, the MultiMediaCard protocol state machine is not observed. All of the MultiMediaCard commands supported in SPI mode are always available.

5.6 Bus Transfer Protection

CRC bits protect every MultiMediaCardRS-MultiMediaCard token transferred on the bus. In SPI mode, the card offers a non-protected mode that enables systems built with reliable data links to exclude the hardware or firmware required for implementing the CRC generation and verification functions. The SPI interface is initialized in the non-protected mode. However, the RESET command CMD0, which is used to switch the card to SPI mode, is received by the card while in MultiMediaCard mode and, therefore, must have a valid CRC field. Since CMD0 has no arguments, the content of all the fields, including the CRC field, are constants and need not be calculated in run time. A valid reset command is: 0x40, 0x0, 0x0, 0x0, 0x0, 0x95 The host can turn the CRC option on and off using the CRC_ON_OFF command CMD59.

5.7 Data Read

SPI Mode supports single block and multiple-block read operations The main difference between SPI and MultiMediaCard modes is that the data and the response are both transmitted to the host on the DataOut signal. Therefore, the card response to the STOP_COMMAND might end abruptly and replace the last data block. Figure 5-2. Figure 5-2 Single Block Read Operation The basic unit of data transfer is a block whose maximum size is defined in the CSD READ_BL_LEN. If READ_BL_PARTIAL is set, smaller blocks whose starting and ending address are entirely contained within one physical block as defined by READ_BL_LEN may also be transmitted. A CRC is appended to the end of each block ensuring data transfer integrity. CMD17 READ_SINGLE_BLOCK initiates a single block read. CMD18 READ_MULTIPLE_BLOCK starts a transfer of several consecutive blocks. The number of blocks for the multiple block read operation is not defined. The card will continuously transfer data blocks until a stop transmission command is received. Command DataIn Command Response Data Block CRC From Host to Card From Card to Host Data from Card to Host Next Command DataOut Revision 1.0 MultiMediaCardRS-MultiMediaCard Product Manual © 2004 SanDisk Corporation 5-5 051304 Figure 5-2 Multiple Block Read Operation In case of a data retrieval error, the card will not transmit any data. Instead, a special data error token will be sent to the host. Figure 5-4 shows a single block-read operation, which terminated with an error token rather than a data block. Figure 5-4 Read Operation—Data Error The multiple block read operation can be terminated the same way by the error token replacing a data block anywhere in the sequence. The host must then abort the operation by sending the Stop Transmission command. If the host sends a Stop Transmission command out of the valid sequence, it will be responded to as an illegal command. If the host uses partial blocks whose accumulated length is not block aligned and block misalignment is not allowed, the card detects a block misalignment error condition at the beginning of the first misaligned block ADDRESS_ERROR error bit is set in the data error token.

5.8 Data Write