English
Language : 

K60P100M100SF2RM Datasheet, PDF (1649/1809 Pages) Freescale Semiconductor, Inc – K60 Sub-Family Reference Manual
Chapter 52 Secured digital host controller (SDHC)
The software flow to write to a card incorporates the internal DMA and the write
operation is a multi-block write with the Auto CMD12 enabled. For the other two
methods (by means of external DMA or CPU polling status) with different transfer
methods, the internal DMA parts should be removed and the alternative steps should be
straightforward.
The software flow to write to a card is described below:
1. Check the card status, wait until the card is ready for data.
2. Set the card block length/size:
a. For SD/MMC cards, use SET_BLOCKLEN (CMD16)
b. For SDIO cards or the I/O portion of SDCombo cards, use IO_RW_DIRECT
(CMD52) to set the I/O Block Size bit field in the CCCR register (for function 0)
or FBR register (for functions 1~7)
c. For CE-ATA cards, configure bits 1~0 in the scrControl register
3. Set the eSDHC block length register to be the same as the block length set for the
card in Step 2.
4. Set the eSDHC number block register (NOB), nob is 5 (for instance).
5. Disable the buffer write ready interrupt, configure the DMA settings and enable the
eSDHC DMA when sending the command with data transfer. The AC12EN bit
should also be set.
6. Wait for the Transfer Complete interrupt.
7. Check the status bit to see if a write CRC error occurred, or some another error, that
occurred during the auto12 command sending and response receiving.
52.6.3.1.2 Write with pause
The write operation can be paused during the transfer. Instead of stopping the SD_CLK
at any time to pause all the operations, which is also inaccessible to the host driver, the
driver can set the PROCTL[SABGREQ] to pause the transfer between the data blocks.
As there is no time-out condition in a write operation during the data blocks, a write to all
types of cards can be paused in this way, and if the DAT0 line is not required to de-assert
to release the busy state, no suspend command is needed.
Like in the flow described in Normal write, the write with pause is shown with the same
kind of write operation:
K60 Sub-Family Reference Manual, Rev. 6, Nov 2011
Freescale Semiconductor, Inc.
1649