![ARTERY AT32F435 Series Скачать руководство пользователя страница 550](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592550.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 550
Rev 2.03
The card identification process is described as follows:
1.
The bus is activated to confirm whether the card is connected or not. The clock frequency is at 0-
400kHz during the card identification process.
2.
The SDIO host sends a SD card, SDI/O card or MMC card.
3.
Card Initialization
―
S
D card: The SDIO host sends CMD2 (ALL_SEND_CID) to obtain its unique CID number.
After receiving a response (CID number) from the card, the host will send CMD3
(SEND_RELATIVE_ADDR), instructing the card to issue the relative card address (RCA),
which is shorter than the CID and is used to address the card in the data transfer mode.
―
SDI/O card: The SDIO host sends CMD3 (SEND_RELATIVE_ADDR) to instruct the card to
release the relative card address (RCA), which is shorter than the CID and is used to address
the card in the data transfer mode.
―
MMC card: The SDIO host sends CMD1 (SEND_OP_COND), followed by CMD2 and CMD3.
4.
If the host wants to assign another RCA number, it can instruct the card to issue a new number by
sending another CMD3 command. The last RCA is the actual RCA number of the card. The host
repeats the card identification process (CMD2 and CMD3 cycle of each card)
25.3.1.2 Data transfer mode
The host will enter data transfer mode after identifying all cards on the bus. In data transfer mode, the
host can operate cards within the range of 0 - 50MHz. It can send CMD9 (SEND_CSD) to get data
specific to a card (CSD register) such as block length and car memory size. All communications between
the host and the selected card are point-to-point transferred, and the CMD bus will confirm all addressed
commands as a response. Data transfer read/write can be done in data block mode or stream mode,
configured by the TFRMODE bit in the SDIO_DTCTRL register. In the data stream mode, data is
transferred in bytes and without CRC appended to the end of each data block.
Wide bus selection/deselection
Wide bus (4-bit bus width) operation mode is selected or deselected by using ACMD6
(SET_BUS_WIDTH). The default bus width after power-up or CMD0 (GO_IDLE_STATE) is 1 bit. The
ACMD6 is only valid in a transfer state, indicating that the bus width can be changed only after a card is
selected by CMD7.
Stream read/write (MultiMedia card only)
Read
:
1.
The host sends CMD11 (READ_DAT_UNTIL_STOP) for stream read.
2.
Until the host sends CMD12 ( STOP_TRANSMISSION ). The stop command has an execution
delay due to the serial command transmission and the data transfers stops after the end bit of
the stop command.
Write
:
1.
The
host sends CMD20 (WRITE_DAT_UNTIL_STOP) for stream write.
2.
Until the host sends CMD12 ( STOP_TRANSMISSION ). As the amount of data to be
transferred is not determined in advance, the CRC cannot be used. When the memory range
is reached, the command will be discarded by the card and remain in a transfer state, and a
response is issued by setting the ADDRESS_OUT_OF_RANGE bit.
Data block read
In block read mode, the basic unit of data transfer is a block whose maximum size (fixed length 512
bytes) is defined in the CSD (READ_BL_LEN). If the READ_BL_PARTIAL is set, smaller blocks whose
start and end addresses are entirely contained within 512 bytes may also be transmitted. A CRC is
appended to the end of each block to ensuring data transfer integrity. Several commands related to data
block read are as follows:
CMD17 ( READ_SINGLE_BLOCK ): initiates a data block read and returns to the transfer state
after the completion of the transfer.
CMD18 ( READ_MULTIPLE_BLOCK ): starts a transfer of several consecutive data blocks.