Atmel ARM-Based Evaluation Kit AT91SAM9N12-EK AT91SAM9N12-EK Data Sheet

Product codes
AT91SAM9N12-EK
Page of 1104
584
SAM9N12/SAM9CN11/SAM9CN12 [DATASHEET]
11063K–ATARM–05-Nov-13
8.
Configure the fields of LLI_W(n).DMAC_CFGx for Channel x as follows:
–FIFOCFG defines the watermark of the DMA channel FIFO.
–DST_REP is set to zero. Address are contiguous.
–SRC_H2SEL is set to true to enable hardware handshaking on the destination.
–SRC_PER is programmed with the hardware handshaking ID of the targeted HSMCI Host 
Controller.
9.
Program LLI_W(n).DMAC_DSCRx with the address of LLI_W(n+1) descriptor. And set the DSCRx_IF to the 
AHB Layer ID. This operation actually links descriptors together. If LLI_W(n) is the last descriptor then 
LLI_W(n).DMAC_DSCRx points to 0.
10. Program the DMAC_CTRLBx register for Channel x with 0. Its content is updated with the LLI Fetch 
operation.
11. Program the DMAC_DSCRx register for Channel x with the address of LLI_W(0).
12. Enable Channel x writing one to DMAC_CHER[x]. The DMAC is ready and waiting for request.
5.
Poll CBTC[x] bit in the DMAC_EBCISR.
6.
If a new list of buffers shall be transferred repeat step 7. Check and handle HSMCI errors.
7.
Poll FIFOEMPTY field in the HSMCI_SR. 
8.
Send The STOP_TRANSMISSION command writing the HSMCI_ARG then the HSMCI_CMDR.
9.
Wait for XFRDONE in the HSMCI_SR.
35.9
SD/SDIO Card Operation
The High Speed MultiMedia Card Interface allows processing of SD Memory (Secure Digital Memory Card) and SDIO
(SD Input Output) Card commands.
SD/SDIO cards are based on the MultiMedia Card (MMC) format, but are physically slightly thicker and feature higher
data transfer rates, a lock switch on the side to prevent accidental overwriting and security features. The physical form
factor, pin assignment and data transfer protocol are forward-compatible with the High Speed MultiMedia Card with some
additions. SD slots can actually be used for more than flash memory cards. Devices that support SDIO can use small
devices designed for the SD form factor, such as GPS receivers, Wi-Fi or Bluetooth adapters, modems, barcode readers,
IrDA adapters, FM radio tuners, RFID readers, digital cameras and more.
SD/SDIO is covered by numerous patents and trademarks, and licensing is only available through the Secure Digital
Card Association.
The SD/SDIO Card communication is based on a 9-pin interface (Clock, Command, 4 x Data and 3 x Power lines).
The communication protocol is defined as a part of this specification. The main difference between the SD/SDIO Card
and the High Speed MultiMedia Card is the initialization process.
The SD/SDIO Card Register (HSMCI_SDCR) allows selection of the Card Slot and the data bus width.
The SD/SDIO Card bus allows dynamic configuration of the number of data lines. After power up, by default,
the SD/SDIO Card uses only DAT0 for data transfer. After initialization, the host can change the bus width (number of
active data lines).
35.9.1  SDIO Data Transfer Type
SDIO cards may transfer data in either a multi-byte (1 to 512 bytes) or an optional block format (1 to 511 blocks), while
the SD memory cards are fixed in the block transfer mode. The TRTYP field in the HSMCI Command Register
(HSMCI_CMDR) allows to choose between SDIO Byte or SDIO Block transfer.
The number of bytes/blocks to transfer is set through the BCNT field in the HSMCI Block Register (HSMCI_BLKR).
In SDIO Block mode, the field BLKLEN must be set to the data block size while this field is not used in SDIO Byte mode.
An SDIO Card can have multiple I/O or combined I/O and memory (called Combo Card). Within a multi-function SDIO or
a Combo card, there are multiple devices (I/O and memory) that share access to the SD bus. In order to allow the sharing
of access to the host among multiple devices, SDIO and combo cards can implement the optional concept of
suspend/resume (Refer to the SDIO Specification for more details). To send a suspend or a resume command, the host
must set the SDIO Special Command field (IOSPCMD) in the HSMCI Command Register.