57
8331B–AVR–03/12
Atmel AVR XMEGA AU
one or more channels should have a fixed priority or if a round robin scheme should be used. A
round robin scheme means that the channel that last transferred data will have the lowest
priority.
5.7
Double Buffering
To allow for continuous transfer, two channels can be interlinked so that the second takes over
the transfer when the first is finished, and vice versa. This leaves time for the application to pro-
cess the data transferred by the first channel, prepare fresh data buffers, and set up the channel
registers again while the second channel is working. This is referred to as double buffering or
chained transfers.
When double buffering is enabled for a channel pair, it is important that the two channels are
configured with the same repeat count. The block sizes need not be equal, but for most applica-
tions they should be, along with the rest of the channel’s operation mode settings.
Note that the double buffering channel pairs are limited to channels 0 and 1 as the first pair and
channels 2 and 3 as the second pair. However, it is possible to have one pair operate in double
buffered mode while the other is left unused or operating independently.
5.8
Transfer Buffers
To avoid unnecessary bus loading when doing data transfer between memories with different
access timing (for example, I/O register and external memory), the DMA controller has a four-
byte buffer. Two bytes will be read from the source address and written to this buffer before a
write to the destination is started.
5.9
Error detection
The DMA controller can detect erroneous operation. Error conditions are detected individually
for each DMA channel, and the error conditions are:
• Write to memory mapped EEPROM locations
• Reading EEPROM when the EEPROM is off (sleep entered)
• DMA controller or a busy channel is disabled in software during a transfer
5.10
Software Reset
Both the DMA controller and a DMA channel can be reset from the user software. When the
DMA controller is reset, all registers associated with the DMA controller, including channels, are
cleared. A software reset can be done only when the DMA controller is disabled.
When a DMA channel is reset, all registers associated with the DMA channel are cleared. A soft-
ware reset can be done only when the DMA channel is disabled.
5.11
Protection
In order to ensure safe operation, some of the channel registers are protected during a transac-
tion. When the DMA channel busy flag (CHnBUSY) is set for a channel, the user can modify only
the following registers and bits:
• CTRL register
• INTFLAGS register
• TEMP registers
• CHEN, CHRST, TRFREQ, and REPEAT bits of the channel CTRL register
• TRIGSRC register