SPRUIM2H May 2020 – October 2023 AM2431 , AM2432 , AM2434 , AM6411 , AM6412 , AM6421 , AM6422 , AM6441 , AM6442
The sequence for not using DMA is shown in Figure 12-1758.
(1) Set the value corresponding to the executed data byte length of one block to the MMCSD0_BLOCK_SIZE register.
(2) Set the value corresponding to the executed data block count to the MMCSD0_BLOCK_COUNT register in accordance with Determination of Transfer Type.
(3) Set the argument value to Argument register (MMCSD0_ARGUMENT1_LO and MMCSD0_ARGUMENT1_HI).
(4) Set the value to the MMCSD0_TRANSFER_MODE register. The Host Driver determines Multi/Single Block Select, Block Count Enable, Data Transfer Direction, Auto CMD12 Enable and DMA Enable in the MMCSD0_TRANSFER_MODE register. Multi/Single Block Select and Block Count Enable are determined according to Determination of Transfer Type.
If response check is enabled (MMCSD0_TRANSFER_MODE[7] RESP_ERR_CHK_ENA = 1), set MMCSD0_TRANSFER_MODE[8] RESP_INTR_DIS bit to 1 and select Response Type R1/R5 (MMCSD0_TRANSFER_MODE[6] RESP_TYPE).
(5) Set the value to MMCSD0_COMMAND register.
Note: When writing the upper byte [3] of MMCSD0_COMMAND register, SD command is issued.
(6) If response check is enabled, go to stop (9) else wait for the Command Complete Interrupt (MMCSD0_NORMAL_INTR_STS[0] CMD_COMPLETE bit).
(7) Write 1 to the MMCSD0_NORMAL_INTR_STS[0] CMD_COMPLETE bit for clearing this bit.
(8) Read Response register (MMCSD0_RESPONSE_0 - MMCSD0_RESPONSE_7) and get necessary information of the issued command.
(9) In the case where this sequence is for write to a card, go to step (10). In case of read from a card, go to step (14).
(10) Then wait for Buffer Write Ready Interrupt (MMCSD0_NORMAL_INTR_STS_ENA[4] BUF_WR_READY).
(11) Write 1 to the MMCSD0_NORMAL_INTR_STS_ENA[4] BUF_WR_READY bit for clearing this bit.
(12) Write block data (in according to the number of bytes specified at the step (1)) to MMCSD0_DATA_PORT register.
(13) Repeat until all blocks are sent and then go to step (18).
(14) Then wait for the Buffer Read Ready Interrupt (MMCSD0_NORMAL_INTR_STS_ENA[5] BUF_RD_READY).
(15) Write 1 to the MMCSD0_NORMAL_INTR_STS_ENA[5] BUF_RD_READY bit for clearing this bit.
(16) Read block data (in according to the number of bytes specified at the step (1)) from the MMCSD0_DATA_PORT register.
(17) Repeat until all blocks are received and then go to step (18).
(18) If this sequence is for Single or Multiple Block Transfer, go to step (19). In case of Infinite Block Transfer, go to step (21).
(19) Wait for Transfer Complete Interrupt (MMCSD0_NORMAL_INTR_STS_ENA[1] XFER_COMPLETE).
(20) Write 1 to the MMCSD0_NORMAL_INTR_STS_ENA[1] XFER_COMPLETE bit for clearing this bit.
(21) Perform the sequence for Abort Transaction in accordance with Section 12.3.5.5.1.8, Abort Transaction.
Note: Step (1) and Step (2) can be executed at same time. Step (4) and Step (5) can be executed at same time.