Atmel Evaluation Kit AT91SAM9X35-EK AT91SAM9X35-EK Data Sheet

Product codes
AT91SAM9X35-EK
Page of 1301
456
SAM9X35 [DATASHEET]
11055E–ATARM–10-Mar-2014
Replay Mode of Channel Registers
During automatic replay mode, the channel registers are reloaded with their initial values at the completion of each buffer
and the new values used for the new buffer. Depending on the row number in 
, some or all of the
DMAC_SADDRx, DMAC_DADDRx, DMAC_CTRLAx and DMAC_CTRLBx channel registers are reloaded from their
initial value at the start of a buffer transfer.
Contiguous Address Between Buffers
In this case, the address between successive buffers is selected to be a continuation from the end of the previous buffer.
E n a b l i n g   t h e   s o u r c e   o r   d e s t i n a t i o n   a d d r e s s   t o   b e   c o n t i g u o u s   b e t w e e n   b u f f e r s   i s   a   f u n c t i o n   o f
DMAC_CTRLAx.SRC_DSCR, DMAC_CFGx.DST_REP, DMAC_CFGx.SRC_REP and DMAC_CTRLAx.DST_DSCR
registers.
Suspension of Transfers Between Buffers
At the end of every buffer transfer, an end of buffer interrupt is asserted if:
The channel buffer interrupt is unmasked, DMAC_EBCIMR.BTCx = ‘1’, where x is the channel number.
Note:
The Buffer Transfer Completed Interrupt is generated at the completion of the buffer transfer to the destination.
At the end of a chain of multiple buffers, an end of linked list interrupt is asserted if:
The channel end of the Chained Buffer Transfer Completed Interrupt is unmasked, DMAC_EBCIMR.CBTCx = ‘1’, 
when n is the channel number.
31.4.4.3 Ending Multi-buffer Transfers
All multi-buffer transfers must end as shown in Row 1 of 
At the end of every buffer transfer, the
DMAC samples the row number, and if the DMAC is in Row 1 state, then the previous buffer transferred was the last
buffer and the DMAC transfer is terminated. 
For rows 9, 10 and 11 of 
, (DMAC_DSCRx = 0 and DMAC_CTRLBx.AUTO is set), multi-buffer
DMAC transfers continue until the automatic mode is disabled by writing a ‘1’ in DMAC_CTRLBx.AUTO bit. This bit
should be programmed to zero in the end of buffer interrupt service routine that services the next-to-last buffer transfer.
This puts the DMAC into Row 1 state.
For rows 2, 3, 4, 5, and 6 (DMAC_CRTLBx.AUTO cleared), the user must set up the last buffer descriptor in memory so
that LLI.DMAC_DSCRx is set to 0.
31.4.5  Programming a Channel
Four registers, the DMAC_DSCRx, the DMAC_CTRLAx, the DMAC_CTRLBx and DMAC_CFGx, need to be
programmed to set up whether single or multi-buffer transfers take place, and which type of multi-buffer transfer is used.
The different transfer types are shown in 
The “BTSIZE, SADDR and DADDR” columns indicate where the values of DMAC_SARx, DMAC_DARx, DMAC_CTLx,
and DMAC_LLPx are obtained for the next buffer transfer when multi-buffer DMAC transfers are enabled.
31.4.5.1 Programming Examples
Single-buffer Transfer (Row 1)
1.
Read the Channel Handler Status Register DMAC_CHSR.ENAx Field to choose a free (disabled) channel.
2.
Clear any pending interrupts on the channel from the previous DMAC transfer by reading the interrupt status regis-
ter, DMAC_EBCISR.
3.
Program the following channel registers:
1. Write the starting source address in the DMAC_SADDRx register for channel x.
2. Write the starting destination address in the DMAC_DADDRx register for channel x.
3. Write the next descriptor address in the DMA_DSCRx register for channel x with 0x0..
4. Program DMAC_CTRLAx, DMAC_CTRLBx and DMAC_CFGx according to Row 1 as shown in 
Program the DMAC_CTRLBx register with both AUTO fields set to 0.