www.ti.com

Procedures for Common Operations

Figure 17. MMC/SD Mode Multiple-Block Read Operation

MMC controller register content

RCA ADDRESS HIGH

RCA ADDRESS LOW

SEL/DESEL. CARD

BLK ADDRESS HIGH

BLK ADDRESS LOW

SET_BLOCKLEN

READ_MULT_BLOCK

Is TOUTRD = 1?

Is CRCRD = 1?

Is DRRDY = 1?

NEXT DATA BYTE

STOP_TRANSMISSION

MMC controller

register

ARG HIGH

ARG LOW

COMMAND

ARG HIGH

ARG LOW

COMMAND

COMMAND

STATUS 0

DATA TX

COMMAND

Select one card with relative card address (RCA) while de−selecting the other cards.

Load starting block address into the high and low argument registers. Load block

length register with the block length value. Start the operation by loading a READ_MULTIPLE_BLOCK command into the command register.

Check TOUTRD bit to verify that the read operation has not timed−out. Check CRCRD bit for

any read CRC errors. Check DRRDY to see if a new byte is in the data receive register.

Terminate the multiple−block read operation.

3.9MMC/SD Mode Multiple-Block Read Operation Using EDMA

To perform a multiple-block read, the same block length must be set in both the MMC/SD controller and the card.

The procedure for this operation is as follows:

1.Write the card’s relative address to the MMC argument registers (MMCARGH and MMCARGL). Load the high part of the address to MMCARGH and the low part of the address to MMCARGL.

2.Read card CSD to determine the card'smaximum block length.

3.Use the MMC command register (MMCCMD) to send the SET_BLOCKLEN command (if the block length is different than the length used in the previous operation). The block length must be a multiple of 512 bytes and less then the maximum block length specified in the CSD.

4.Reset the FIFO (FIFORST bit in MMCFIFOCTL).

5.Set the FIFO direction to receive (FIFODIR bit in MMCFIFOCTL).

6.Set the FIFO threshold (FIFOLEV bit in MMCFIFOCTL).

7.Set the access width (ACCWD bits in MMCFIFOCTL).

8.Set up DMA (DMA size needs to be greater than or equal to FIFOLEV setting).

9.Use MMCCMD to send the READ_MULTI_BLOCK command to the card.

10.Wait for DMA sequence to complete.

11.Use the MMC status register 0 (MMCST0) to check for errors.

12.Use MMCCMD to send the STOP_TRANSMISSION command.

SPRUE30B –September 2006

Multimedia Card (MMC)/Secure Digital (SD) Card Controller

39

Submit Documentation Feedback

Page 39
Image 39
Texas Instruments TMS320DM644x manual MMC/SD Mode Multiple-Block Read Operation Using Edma