Texas Instruments TMS320DM644x User Manual

Page of 61
www.ti.com
2.9.7.8
Determining When Last Data has Been Written to Card (SanDisk SD cards)
2.9.7.9
Checking For a Data Transmit Empty Condition
2.9.7.10
Checking for a Data Receive Full Condition
2.9.7.11
Checking the Status of the SD_CLK Pin
2.9.7.12
Checking the Remaining Block Count During a Multiple-Block Transfer
Peripheral Architecture
Some SanDisk brand SD™ cards exhibit a behavior that requires a multiple-block write command to
terminate with a STOP (CMD12) command before the data write sequence completes. To enable support
of this function, the transfer done interrupt (TRNDNE) is provided. Set the ETRNDNE bit in MMCIM to
enable the TRNDNE interrupt. This interrupt is issued when the last byte of data (as defined by
MMCNBLK and MMCBLEN) is transferred from the FIFO to the output shift register. The CPU should
respond to this interrupt by sending a STOP command to the card. This interrupt differs from DATDNE by
timing. DATDNE does not occur until after the CRC and memory programming are complete.
During transmission, a data value is passed from the MMC data transmit register (MMCDXR) to the data
transmit shift register. The data is then passed from the shift register to the memory card one bit at a time.
The DXEMP bit in MMCST1 indicates when the shift register is empty.
Typically, the DXEMP bit is not used to control data transfers; rather, it is checked during recovery from an
error condition. There is no interrupt associated with the DXEMP bit.
During reception, the data receive shift register accepts a data value one bit at a time. The entire value is
then passed from the shift register to the MMC data receive register (MMCDRR). The DRFUL bit in
MMCST1 indicates that when the shift register is full no new bits can be shifted in from the memory card.
The DRFUL bit is not typically used to control data transfers; rather, it is checked during recovery from an
error condition. There is no interrupt associated with the DRFUL bit.
Read the CLKSTP bit in MMCST1 to determine whether the memory clock has been stopped on the
SD_CLK pin.
During a transfer of multiple data blocks, the MMC number of blocks counter register (MMCNBLC)
indicates how many blocks are remaining to be transferred. The MMCNBLC is a read-only register.
Multimedia Card (MMC)/Secure Digital (SD) Card Controller
26
SPRUE30B – September 2006