![Texas Instruments AM1808 Скачать руководство пользователя страница 1281](http://html.mh-extra.com/html/texas-instruments/am1808/am1808_technical-reference-manual_10945581281.webp)
Architecture
1281
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Multimedia Card (MMC)/Secure Digital (SD) Card Controller
26.2.9.7.4 Checking for Time-Out Events
The MMC/SD controller sets the TOUTRS and TOUTRD bits in MMCST0 in response to the
corresponding command response or data read time-out event. If the interrupt request is enabled
(ETOUTRS/ETOUTRD = 1 in MMCIM), the CPU is notified of the event by an interrupt.
26.2.9.7.5 Determining When a Response/Command is Done
The MMC/SD controller sets the RSPDNE bit in MMCST0 when the response is done; or in the case of
commands that do not require a response, when the command is done. If the interrupt request is enabled
(ERSPDNE = 1 in MMCIM), the CPU is also notified.
26.2.9.7.6 Determining Whether the Memory Card is Busy
The card sends a busy signal either when waiting for an R1b-type response or when programming the last
write data into its flash memory. The MMC/SD controller has two flags to notify you whether the memory
card is sending a busy signal. The two flags are complements of each other:
•
The BSYDNE flag in MMCST0 is set if the card did not send or is not sending a busy signal when the
MMC/SD controller is expecting a busy signal (BSYEXP = 1 in MMCCMD). The interrupt by this bit is
enabled by a corresponding interrupt enable bit (EBSYDNE = 1 in MMCIM).
•
The BUSY flag in MMCST1 is set when a busy signal is received from the card.
26.2.9.7.7 Determining Whether a Data Transfer is Done
The MMC/SD controller sets the DATDNE bit in MMCST0 when all of the bytes of a data transfer have
been transmitted/received. The DATDNE bit is polled to determine when to stop writing to the data
transmit register (for a write operation) or when to stop reading from the data receive register (for a read
operation). The CPU is also notified of the time-out event by an interrupt if the interrupt request is enabled
(EDATDNE = 1 in MMCIM).
26.2.9.7.8 Determining When Last Data has Been Written to Card (SanDisk SD cards)
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.
26.2.9.7.9 Checking For a Data Transmit Empty Condition
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.
26.2.9.7.10 Checking for a Data Receive Full Condition
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.