188
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
6.
If necessary, configure circular mode.
7.
If it is memory to memory, configure MEM2MEM mode.
8.
Repeat step 1~8 on channel 1~8.
9.
Enable corresponding channel.
If software is used to serve interrupt, software must enquire interrupt status register to check which interrupt occurred
(software needs to write 1 to interrupt flag clear bit to clear the corresponding interrupt). Before enable channel, all
interrupts corresponding to the channel should be cleared.
If the interrupt is transfer complete interrupt, software can configure the next transfer, or report to user this channel
transformation is done.
8.4.7
Flow control
Three major flow controls are supported:
Memory to memory
Memory to peripheral
Peripheral to memory
Flow control is controlled by two register bits in each DMA channel configuration register. Flow control is used to
control source/destination and direction of DMA channel.
Table 8-2 Flow control table
DMA_CHCFGx.MEM2MEM DMA_CHCFGx.DIR
Source
Destination
Transfer
1
x
Memory
Memory
AHB read to AHB write, can do back2back
transfer
0
1
Memory
AHB Peripheral
AHB read to AHB write, single transfer
APB Peripheral
AHB read to APB write, single transfer
0
0
AHB
Peripheral
Memory
AHB read to AHB write, single transfer
APB Peripheral
APB read to AHB write, single transfer
8.4.8
Circular mode
The circular mode is used to process circular buffers and continuous data transmission (such as ADC scan mode).
The DMA_CHCFGx.CIRC is used to enable this function. When the circular mode is activated, if the number of data
to be transferred becomes 0, it will automatically be restored to the initial value when configuring the channel, and
the DMA operation will continue.
If the user wants to turn off the circular mode, the user needs to write 0 to DMA_CHCFGx.CHEN to disable the
DMA channel, and then write 0 to DMA_CHCFGx.CIRC (when DMA_CHCFGx.CHEN is 1, other bits in the
DMA_CHCFGx register cannot be rewritten).