GD32A50x User Manual
235
The CNT bits in the DMA_CHxCNT register control how many data to be transmitted on the
channel and must be configured before enable the CHEN bit in the register. During the
transmission, the CNT bits indicate the remaining number of data items to be transferred.
The DMA transmission is disabled by clearing the CHEN bit in the DMA_CHxCTL register.
If the DMA transmission is not completed when the CHEN bit is cleared, two situations
may be occurred when restart this DMA channel:
–
If no register configuration operations of the channel occurs before restart the
DMA channel, the DMA will continue to complete the rest of the transmission.
–
If any register configuration operations occur, the DMA will restart a new
transmission.
If the DMA transmission has been finished when clearing the CHEN bit, enable the
DMA channel without any register configuration operation will not launch any DMA
transfer.
11.4.2.
Peripheral handshake
To ensure a well-organized and efficient data transfer, a handshake mechanism is introduced
between the DMA and peripherals, including a request signal and an acknowledge signal:
Request signal asserted by peripheral to DMA controller, indicating that the peripheral
is ready to transmit or receive data.
Acknowledge signal responded by DMA to peripheral, indicating that the DMA
controller has initiated an AHB command to access the peripheral.
Figure 11-2. Handshake mechanism
shows how the handshake mechanism works between
the DMA controller and peripherals.
Figure 11-2. Handshake mechanism
DMA
Acknowledge
Peripheral
request
Peripheral is ready to transmit
or receive data, and assert the
request signal to DMA
Peripheral request
Peripheral
request
DMA acknowledge
Wait the DMA bus idle and
other higher priority channels
to have been processed
The corresponding channel has
the highest priority and the DMA
controller sents an AHB command
to access the peripheral
Peripheral releases the
request signal when it receives
the acknowledge signal
The DMA controller deasserts
the acknowledge signal when
it receives low request signal
Peripheral launches
the next request
11.4.3.
Arbitration
When two or more requests are received at the same time, the arbiter determines which
request is served based on the priorities of channels. There are two-stage priorities, including