648
/
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
Figure 23-7 Transmission using DMA
Using DMA reception
Set USART_CTRL3.DMARXEN to enable DMA mode when receiving. When a byte is received
(USART_STS.RXDNE=1), the DMA will transfer the data from the USART_DAT register of the USART to the
SRAM.
When using DMA reception, the process of configuring the DMA channel is as follows:
1.
Set the address of the USART_DAT register. When a data transfer request occurs, this address will be the source
address of the data transfer.
2.
Set the address of the data memory. When a data transfer request occurs, the transferred data will be written to this
address.
3.
Set the amount of data to transfer.
4.
Set the priority of the channel, set whether to use the cyclic mode, the incremental mode of peripherals and memory,
the data width of peripherals and memory, the interrupt generated by half of the transfer or the interrupt when the
transfer is completed.
5.
Start the channel.
TX line
TXDE flag
TXC flag
Data 0
Data 1
Data N
set by hardware
set by hardware
DMA request
DMA TXCF Flag
cleared by DMA
DMA writes Data0
into USART_DAT
DMA writes Data1
into USART_DAT
DMA writes DataN
into USART_DAT
Software waits
TXC=1
set by hardware
cleared by software
DMA transfer
is complete