65.14.5 SDMMC Transfer Mode Register

This register is used to control data transfers. The user shall set this register before issuing a command which transfers data (see SDMMC_CR.DPSEL), or before issuing a Resume command. The user must save the value of this register when the data transfer is suspended (as a result of a Suspend command) and restore it before issuing a Resume command. To prevent data loss, this register cannot be written while data transactions are in progress. Writes to this register are ignored when SDMMC_PSR.CMDINHD is 1.

Table 65-3. Determining the Transfer Type
MSBSEL BCEN BLKCNT (SDMMC_BCR) Function
0 Don’t care Don’t care Single Transfer
1 0 Don’t care Infinite Transfer
1 1 Not Zero Multiple Transfer
1 1 Zero Stop Multiple Transfer
Name: SDMMC_TMR
Offset: 0x0C
Reset: 0x0000
Property: Read/Write

Bit 15141312111098 
          
Access  
Reset  
Bit 76543210 
   MSBSELDTDSELACMDEN[1:0]BCENDMAEN 
Access R/WR/WR/WR/WR/WR/W 
Reset 000000 

Bit 5 – MSBSEL Multi/Single Block Selection

This bit is set to 1 when issuing multiple-block transfer commands using DAT line(s). For any other commands, set this bit to 0. If this bit is 0, it is not necessary to set SDMMC_BCR (see the table Determing the Transfer Type).

Bit 4 – DTDSEL Data Transfer Direction Selection

This bit defines the direction of the DAT lines data transfers. Set this bit to 1 to transfer data from the device (SD Card/SDIO/e.MMC) to the SDMMC, and to 0 for all other commands.

0 (WRITE): Writes data from the SDMMC to the device.

1 (READ): Reads data from the device to the SDMMC.

Bits 3:2 – ACMDEN[1:0] Auto Command Enable

Two methods can be used to stop Multiple-block read and write operation:

  • Auto CMD12: when the ACMDEN field is set to 1, the SDMMC issues CMD12 automatically when the last block transfer is completed. An Auto CMD12 error is indicated to SDMMC_ACESR. Auto CMD12 is not enabled if the command does not require CMD12.
  • Auto CMD23: when the ACMDEN field is set to 2, the SDMMC issues a CMD23 automatically before issuing a command specified in SDMMC_CR.

The following conditions are required to use Auto CMD23:

  • A memory card that supports CMD23 (SCR[33] = 1)
  • If DMA is used, it must be ADMA (SDMA not supported).
  • Only CMD18 or CMD25 is issued.
Note: The SDMMC does not check the command index.

Auto CMD23 can be used with or without ADMA. By writing SDMMC_CR, the SDMMC issues a CMD23 first and then issues a command specified by the SDMMC_CR.CMDIDX field. If CMD23 response errors are detected, the second command is not issued. A CMD23 error is indicated in SDMMC_ACESR. The CMD23 argument (32-bit block count value) is set in SDMMC_SSAR.

This field determines the use of auto command functions.

ValueNameDescription
0 DISABLED

Auto Command Disabled

1 CMD12

Auto CMD12 Enabled

2 CMD23

Auto CMD23 Enabled

3

Reserved

Bit 1 – BCEN Block Count Enable

This bit is used to enable SDMMC_BCR, which is only relevant for multiple block transfers. When this bit is 0, SDMMC_BCR is disabled, which is useful when executing an infinite transfer (see the table Determing the Transfer Type). If an ADMA2 transfer is more than 65535 blocks, this bit is set to 0 and the data transfer length is designated by the Descriptor Table.

0 (DISABLED): Block count is disabled.

1 (ENABLED): Block count is enabled.

Bit 0 – DMAEN DMA Enable

This bit enables the DMA functionality described in section “Supporting DMA” in “SD Host Controller Simplified Specification V3.00” . DMA can be enabled only if it is supported as indicated by the bit SDMMC_CA0R.ADMA2SUP. One of the DMA modes can be selected using the field SDMMC_HC1R.DMASEL. If DMA is not supported, this bit is meaningless and then always reads 0. When this bit is set to 1, a DMA operation begins when the user writes to the upper byte of SDMMC_CR.

0 (DISABLED): DMA functionality is disabled.

1 (ENABLED): DMA functionality is enabled.