UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2015. All rights reserved.
User manual
Rev. 2.1 — 10 December 2015
573 of 1441
NXP Semiconductors
UM10503
Chapter 22: LPC43xx/LPC43Sxx SD/MMC interface
For the data transfer commands, it is important that the same bus width that is
programmed in the card should be set in the card type register @0x18. Therefore, in order
to change the bus width, you should always use the following supplied APIs as
appropriate for the type of card:
•
Set_SD_Mode() - SD/SDIO card
•
Set_HSmodeSettings() - HSMMC card
The Module generates an interrupt for different conditions during data transfer, which are
reflected in the RINTSTS register @0x44 as:
1. Data_Transfer_Over (bit 3) - When data transfer is over or terminated. If there is a
response time-out error, then the Module does not attempt any data transfer and the
"Data Transfer Over" bit is never set.
2. Transmit_FIFO_Data_request (bit 4) - FIFO threshold for transmitting data was
reached; software is expected to write data, if available, in FIFO.
3. Receive_FIFO_Data_request (bit 5) - FIFO threshold for receiving data was reached;
software is expected to read data from FIFO.
4. Data starvation by Cpu time-out (bit 10) - FIFO is empty during transmission or is full
during reception. Unless software writes data for empty condition or reads data for full
condition, the Module cannot continue with data transfer. The clock to the card has
been stopped.
5. Data read time-out error (bit 9) - Card has not sent data within the time-out period.
6. Data CRC error (bit 7) - CRC error occurred during data reception.
7. Start bit error (bit 13) - Start bit was not received during data reception.
8. End bit error (bit 15) - End bit was not received during data reception or for a write
operation; a CRC error is indicated by the card.
Conditions 6, 7, and 8 indicate that the received data may have errors. If there was a
response time-out, then no data transfer occurred.
22.7.4.6 Single-Block or Multiple-Block Read
Steps involved in a single-block or multiple-block read are:
1. Write the data size in bytes in the BYTCNT register @0x20.
2. Write the block size in bytes in the BLKSIZ register @0x1C. The Module expects data
from the card in blocks of size BLKSIZ each.
3. Program the CMDARG register @0x28 with the data address of the beginning of a
data read. Program the Command register with the parameters listed in
For SD and MMC cards, use CMD17 for a single-block read and CMD18 for a
multiple-block read. For SDIO cards, use CMD53 for both single-block and
multiple-block transfers.
After writing to the CMD register, the Module starts executing the command; when the
command is sent to the bus, the command_done interrupt is generated.
4. Software should look for data error interrupts; that is, bits 7, 9, 13, and 15 of the
RINTSTS register. If required, software can terminate the data transfer by sending a
STOP command.