52
XMEGA A [MANUAL]
8077I–AVR–11/2012
5.4
Transfer Triggers
DMA transfers can be started only when a DMA transfer request is detected. A transfer request can be triggered from
software, from an external trigger source (peripheral), or from an event. There are dedicated source trigger selections for
each DMA channel. The available trigger sources may vary from device to device, depending on the modules or
peripherals that exist in the device. Using a transfer trigger for a module or peripherals that does not exist will have no
By default, a trigger starts a block transfer operation. When the block transfer is complete, the channel is automatically
disabled. When enabled again, the channel will wait for the next block transfer trigger. It is possible to select the trigger to
start a burst transfer instead of a block transfer. This is called a single-shot transfer, and for each trigger only one burst is
transferred. When repeat mode is enabled, the next block transfer does not require a transfer trigger. It will start as soon
as the previous block is done.
If the trigger source generates a transfer request during an ongoing transfer, this will be kept pending, and the transfer
can start when the ongoing one is done. Only one pending transfer can be kept, and so if the trigger source generates
more transfer requests when one is already pending, these will be lost.
5.5
Addressing
The source and destination address for a DMA transfer can either be static or automatically incremented or
decremented, with individual selections for source and destination. When address increment or decrement is used, the
default behaviour is to update the address after each access. The original source and destination addresses are stored
by the DMA controller, and so the source and destination addresses can be individually configured to be reloaded at the
following points:
End of each burst transfer
End of each block transfer
End of transaction
Never reloaded
5.6
Priority Between Channels
If several channels request a data transfer at the same time, a priority scheme is available to determine which channel is
allowed to transfer data. Application software can decide whether 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 process 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 applications 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.