13.5.1 Basic Setup
To set up a DMA channel for any data transfer:
- Enable the DMA Controller (ON =
1
) and select an appropriate channel priority scheme by setting or clearing the PRIORITY bit. - Program DMAHIGH and DMALOW with the appropriate upper and lower address boundaries for data RAM operations.
- Select the DMA channel to be used and
disable its operation (CHEN =
0
). - Program the appropriate source and destination addresses for the transaction into the channel’s DMAxSRC and DMAxDST registers. For PIA Mode Addressing, use the base address value.
- Program the RELOAD registers for source address, destination address and count depending on the transfer modes used.
- Program the DMAxCNT register for the number of triggers per transfer (One-Shot or Continuous modes) or the number of words (bytes) to be transferred (Repeated modes).
- Configure the SIZE[1:0] bits to select the data size.
- Program the TRMODE[1:0] bits to select the Data Transfer mode.
- Program the SAMODE[1:0] and DAMODE[1:0] bits to select the Addressing mode.
- Program the CHSEL[7:0] bits to select the trigger source
- Enable the DMA channel by setting the CHEN bit.
- Enable the trigger source interrupt.