Atmel Evaluation Kit for AT32uC3A0512, 32-Bit AVR Microcontroller Atmel ATEVK1105 ATEVK1105 Data Sheet

Product codes
ATEVK1105
Page of 826
155
AT32UC3A
transfer. The address will be increased by either 1, 2 or 4 depending on the size of the DMA
transfer (Byte, Half-Word or Word). The Memory Address Register can be read at any time dur-
ing transfer.
21.4.3
Transfer Counter
Each channel has a 16-bit Transfer Counter Register (TCR). This register must be programmed
with the number of transferred to be performed. TCR should contain the number of data items to
be transferred independently of the transfer size. The Transfer Counter Register can be read at
any time during transfer to see the number of remaining transfers.
21.4.4
Reload Registers
Both the Memory Address Register and the Transfer Counter Register have a reload register,
respectively Memory Address Reload Register (MARR) and Transfer Counter Reload Register
(TCRR). These registers provide the possibility for the PDCA to work on two memory buffers for
each channel. When one buffer has completed, MAR and TCR will be reloaded with the values
in MARR and TCRR. The reload logic is always enabled and will trigger if the TCR reaches zero
while TCRR holds a non-zero value.
21.4.5
Peripheral Selection
The Peripheral Select Register decides which peripheral should be connected to the PDCA
channel. Configuring PSR will both select the direction of the transfer (memory to peripheral or
peripheral to memory), which handshake interface to use, and the address of the peripheral
holding register.
21.4.6
Transfer Size
The transfer size can be set individually for each channel to be either Byte, Half-Word or Word
(8-bit, 16-bit or 32-bit respectively). Transfer size is set by programming the SIZE bit-field in the
Mode Register (MR).
21.4.7
Enabling and Disabling
Each DMA channel is enabled by writing ‘1’ to the Transfer Enable bit (TEN) in the Control Reg-
ister (CR) and disabled by writing ‘1’ to the Transfer Disable bit (TDIS). The current status can
be read from the Status Register (SR).
21.4.8
Interrupts
Interrupts can be enabled by writing to the Interrupt Enable Register (IER) and disabled by writ-
ing to Interrupt Disable Register (IDR). The Interrupt Mask Register (IMR) can be read to see
whether an interrupt is enabled or not. The current status of an interrupt source can be read
through the Interrupt Status Register (ISR).
The PDCA has three interrupt sources:
• Reload Counter Zero - The Transfer Counter Reload Register is zero.
• Transfer Finished - Both the Transfer Counter Register and Transfer Counter Reload Register
are zero.
• Transfer Error - An error has occurred in accessing memory.
32058K
AVR32-01/12