Atmel Xplained Pro Evaluation Kit for the ATSAMD21J18A Microcontroller ATSAMD21-XPRO ATSAMD21-XPRO Data Sheet

Product codes
ATSAMD21-XPRO
Page of 1018
274
Atmel | SMART SAM D21 [DATASHEET]
Atmel-42181C–SAM-D21_Datasheet–07/2014
z
If the DMA has not already fetched the descriptor which requires changes:
z
Update the DESCADDR location of the descriptor from the List
z
Optionally clear the Suspend block action
z
Set the descriptor VALID bit to one
z
Optionally enable the Resume software command
z
If the DMA is executing the same descriptor as the one which requires changes:
z
Set the Channel Suspend software command and wait for the Suspend interrupt
z
Update the Write-Back next descriptor address (DESCRADDR) 
z
Clear the interrupt sources and set the Resume software command
z
Update the DESCADDR location of the descriptor from the List
z
Optionally clear the Suspend block action
z
Set the descriptor VALID bit to one
6.
Go to step 3 if needed
Adding a Descriptor Between Existing Descriptors
To insert a descriptor C between 2 existing descriptors (A & B), the descriptor currently executed by the DMA must be 
identified.
1.
If DMA is executing descriptor B, descriptor C cannot be inserted.
2.
If DMA has not started to execute descriptor A, follow the steps:
a. Set the descriptor A VALID bit to 0
b. Set the DESCADDR value of descriptor A to point descriptor C instead of descriptor B
c.
Set the DESCADDR value of descriptor C to point descriptor B 
d. Set the descriptor A VALID bit to 1.
3.
If DMA is executing descriptor A, 
a. Apply the software suspend command to the channel and 
b. Perform steps 2a through 2d
Apply the software resume command to the channel.
19.6.3.2  Channel Suspend
The channel operation can be suspended at anytime by software, by setting the Suspend command in Command bit field 
of Channel Control B register (
.CMD). When the ongoing burst transfer is completed, the channel operation is 
suspended and the suspend command is automatically cleared.
It is also possible to suspend a channel operation after a block transfer completes. The software must set the Suspend 
Block Action in the corresponding Block Transfer Control location (
.BLOCKACT). When the block transfer is 
completed, the channel operation is suspended. The channel is kept enabled, can receive transfer triggers, but it will be 
removed from the arbitration scheme. The channel will automatically suspend the operation if an invalid transfer control 
descriptor is fetched from system memory (
.VALID=0). The Channel Fetch Error bit in the Channel Status 
.FERR) is set when an invalid descriptor is fetched. Only an enabled channel can be suspended. If 
the channel is disabled when suspended, the internal suspend command is cleared. When suspended, the Channel 
Suspend Interrupt flag in the Channel Interrupt Status and Clear register (
.SUSP) is set and optional 
suspend interrupt is generated.
For more details on transfer descriptors, refer to 
.
19.6.3.3  Channel Resume and Next Suspend Skip
A channel operation can be resumed by software by setting the Resume command in Command bitfield of Channel 
Control B register (
.CMD). If the channel is already suspended, the channel operation resumes from where it 
previously stopped when the Resume command is detected. When the Resume command is issued before the channel 
is suspended, the next suspend action is skipped and the channel continues the normal operation.