GD32W51x User Manual
322
Transfer width, burst and counter
Transfer width
PWIDTH and MWIDTH in the DMA_CHxCTL register indicate the data width of a peripheral
and memory transfer seperately. The DMA supports 8-bit, 16-bit and 32-bit transfer width. In
multi-data mode, if PWIDTH is not equal to MWIDTH, the DMA can automatically
packs/unpacks data to achieve an integrated and correct data transfer operation. In single-
data mode, MWIDTH is automatically locked as PWIDTH by hardware immediately after
enable the DMA channel.
Transfer burst type
PBURST and MBURST in the DMA_CHxCTL register indicate the burst type of a peripheral
and memory transfer seperately. The DMA supports single burst, 4-beat, 8-beat and 16-beat
incrementing burst for peripheral port and memory port. In single-data mode, only single burst
type is supported and PBURST and MBURST are automatically locked as ‘00’ by hardware
immediately after enable the DMA channel.
In peripheral-to-memory or memory-to-
peripheral mode, if PBURST is different from ‘00’,
DMA responses a increasing burst transfer of 4, 8, 16-beat based on the PBURST bits for
each peripheral request. If the remaining bytes number of data item to be transferred is less
than the bytes number needed for a burst transfer, the remaining data items are transferred
in single transaction.
AMBA protocol specifies that bursts must not cross a 1kB address boundary, or a transfer
error will be responsed to the master. In each DMA, the peripheral burst transfer crossing a
1kB address boundary is decomposed to 4, 8 or 16 single transactions depend on the
PBURST bits, as the same as the memory burst transfer.
Transfer counter
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. If the peripheral
is configured as the flow controller, the CNT bits are forced to ‘0xFFFF’ immediately after
enabling the channel whatever the CNT bits are. During the transmission, the CNT bits
indicate the remaining number of data items to be transferred.
The CNT bits are related to peripheral transfer width, the number of data bytes to be
transferred is the CNT bits multiplied by the byte number of the peripheral transfer width. For
example, if the PWIDTH bits are equal to ‘11’, and the number of data bytes to be transferred
is CNT×4. The CNT bits is decreased by 1 when a single or a beat of the burst peripheral
transfer (the source memory transfer in the memory-to-memory mode) has been completed
even if the transfer mode is peripheral-to-memory or memory-to-memory.
When configuring the CNT bits, the following rules must be respected to guarantee a good
DMA operation: