Datasheet

SAM3X / SAM3A [DATASHEET]
Atmel-11057C-ATARM-SAM3X-SAM3A-Datasheet_23-Mar-15
928
37.8.6.3 Block Length is Not Multiple of 4, with Padding Value (ROPT field in HSMCI_DMA register set to 1)
When the ROPT field is set to one, The DMA Controller performs only WORD access on the bus to transfer a non-
multiple of 4 block length. Unlike previous flow, in which the transfer size is rounded to the nearest multiple of 4.
1. Program the HSMCI Interface, see previous flow.
ROPT field is set to 1.
2. Program the DMA Controller
a.Read the channel Register to choose an available (disabled) channel.
b.Clear any pending interrupts on the channel from the previous DMA transfer by reading the
DMAC_EBCISR register.
c. Program the channel registers.
d. The DMAC_SADDRx register for channel x must be set with the starting address of the HSMCI_FIFO
address.
e
.
The DMAC_DADDRx register for channel x must be word aligned.
f. Program DMAC_CTRLAx register of channel x with the following field’s values:
–DST_WIDTH is set to WORD
SRC_WIDTH is set to WORD
SCSIZE must be set according to the value of HSMCI_DMA.CHKSIZE Field.
–BTSIZE is programmed with CEILING(block_length/4).
g. Program DMAC_CTRLBx register for channel x with the following field’s values:
–DST_INCR is set to INCR
SRC_INCR is set to INCR
–FC field is pr
og
rammed with peripheral to memory flow control mode.
both DST_DSCR and SRC_DSCR are set to 1. (descriptor fetch is disabled)
–DIF and SIF are set with their respective layer ID. If SIF is different from DIF, the DMA Controller is
able to prefetch data and write HSMCI simultaneously.
h. Program DMAC_CFGx register for channel x with the following field’s values:
–FIFOCFG defines the watermark of the DMA channel FIFO.
SRC_H2SEL is set to true to enable hard
ware
handshaking on the destination.
SRC_PER is programmed with the hardware handshaking ID of the targeted HSMCI Host
Controller.
–Enable Channel x writing one to DMAC_CHER[x]. The DMAC is ready and waiting for request.
3. Wait for XFRDONE in HSMCI_SR register.