MultiMediaCard
TM
83
Sep.22.2005
Revision 0.3
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. Two types of multiple block read transactions are defined (the host can use
either one at any time):
Open-ended Multiple block read
The number of blocks for the read multiple block operation is not defined. The card will continuously transfer data blocks
until a stop transmission command is received.
Multiple block read with pre-defined block count
The card will transfer the requested number of data blocks and terminate the transaction. Stop command is not required at
the end of this type of multiple block read, unless terminated with an error. In order to start a multiple block read with pre-
defined block count the host must use the SET_BLOCK_COUNT command (CMD23) immediately preceding the
READ_MULTIPLE_BLOCK (CMD18) command. Otherwise the card will start an open-ended multiple block read which
can be stopped using the STOP_TRANSMISION command.
If the host provides an out of range address as an argument to either CMD17 or CMD18, or the currently defined block
length is illegal for a read operation, the card will reject the command and respond with the ADDRESS_OUT_OF_RANGE
or BLOCK_LEN_ERROR bit set, respectively.
If the host sets the argument of the SET_BLOCK_COUNT command (CMD23) to all 0s, then the command is accepted;
however, a subsequent read will follow the open-ended multiple block read protocol (STOP_TRANSMISSION command -
CMD12 - is required).
The host can abort reading at any time, within a multiple block operation, regardless of the its type. Transaction abort is
done by sending the stop transmission command.
If the host provides an out of range address as an argument to either CMD17 or CMD18, or the currently defined block
length is illegal for a read operation, the card will reject the command and respond with the ADDRESS_OUT_OF_RANGE
or BLOCK_LEN_ERROR bit set, respectively.
If the host sets the argument of the SET_BLOCK _COUNT command (CMD23) to all 0s, then the command is accepted:
however , a subsequent read will follow the open-ended multiple block read protocol (STOP_TRANSMISSION command -
CMD12 - is required).
In case of a data retrieval error (e.g. out of range, address misalignment, internal error, etc.) detected during data transfer,
the card will not transmit any data. Instead (as opposed to MultiMediaCard mode where the card times out), a special data
error token will be sent to the host. Figure 7-4 shows a single block read operation which terminates with an error token
rather than a data block.
Figure 7-4 : SPI Read Operation - Data Error
Multiple block read operation can be terminated the same way, the error token replacing a data block anywhere in the
sequence. The host must than abort the operation by sending the stop transmission command.
If the host sends a stop transmission command after the card transmitted the last block of a multiple block read with a pre-
defined number of blocks, it will be responded to as an illegal command.
command
DataIn
DataOut
from
host
to card
data error token
from card to host
from
card
to host
data error
response
command
Next
Command