Atmel Xplained Evaluation Board AT32UC3A3-XPLD AT32UC3A3-XPLD 데이터 시트

제품 코드
AT32UC3A3-XPLD
다운로드
페이지 1021
341
32072H–AVR32–10/2012
AT32UC3A3
19.10.1.5
Multi-block Transfer with Source Address Auto-reloaded and Contiguous Destination Address (Row 3)
1.
Read the Channel Enable register to choose a free (disabled) channel.
2.
Clear any pending interrupts on the channel from the previous DMA transfer by writing 
a ‘1’ to the Interrupt Clear registers: ClearTfr, ClearBlock, ClearSrcTran, ClearDstTran, 
ClearErr. Reading the Interrupt Raw Status and Interrupt Status registers confirms that 
all interrupts have been cleared.
3.
Program the following channel registers:
a.
Write the starting source address in the SARx register for channel x.
b.
Write the starting destination address in the DARx register for channel x.
c.
Program CTLx and CFGx according to Row 3 as shown in 
Program the LLPx register with ‘0’.
d.
Write the control information for the DMA transfer in the CTLx register for channel 
x. For example, in this register, you can program the following:
– i. Set up the transfer type (memory or non-memory peripheral for source and 
destination) and flow control device by programming the TT_FC of the CTLx register.
– ii. Set up the transfer characteristics, such as:
– Transfer width for the source in the SRC_TR_WIDTH field. 
– Transfer width for the destination in the DST_TR_WIDTH field.
– Source master layer in the SMS field where source resides.
– Destination master layer in the DMS field where destination resides.
– Incrementing/decrementing or fixed address for source in SINC field.
– Incrementing/decrementing or fixed address for destination in DINC field.
e.
Write the channel configuration information into the CFGx register for channel x.
– i. Designate the handshaking interface type (hardware or software) for the source 
and destination peripherals. This is not required for memory. This step requires 
programming the HS_SEL_SRC/HS_SEL_DST bits, respectively. Writing a ‘0’ 
activates the hardware handshaking interface to handle source/destination requests 
for the specific channel. Writing a ‘1’ activates the software handshaking interface to 
handle source/destination requests.
– ii. If the hardware handshaking interface is activated for the source or destination 
peripheral, assign handshaking interface to the source and destination peripheral. 
This requires programming the SRC_PER and DEST_PER bits, respectively.
4.
After the DMACA channel has been programmed, enable the channel by writing a ‘1’ to 
the ChEnReg.CH_EN bit. Make sure that bit 0 of the DmaCfgReg register is enabled.
5.
Source and destination request single and burst DMACA transactions to transfer the 
block of data (assuming non-memory peripherals). The DMACA acknowledges at the 
completion of every transaction (burst and single) in the block and carries out the block 
transfer.
6.
When the block transfer has completed, the DMACA reloads the SARx register. The 
DARx register remains unchanged. Hardware sets the block complete interrupt. The 
DMACA then samples the row number as shown in 
. If the 
DMACA is in Row 1, then the DMA transfer has completed. Hardware sets the transfer 
complete interrupt and disables the channel. So you can either respond to the Block 
Complete or Transfer Complete interrupts, or poll for the Channel Enable (ChEn-