11.2 Typical Setup

To set up a DMA channel for a basic data transfer:

  1. Enable the DMA Controller (DMAEN = 1) and select an appropriate channel priority scheme by setting or clearing PRSSEL.
  2. Program DMAH and DMAL with appropriate upper and lower address boundaries for data RAM operations.
  3. Select the DMA channel to be used and disable its operation (CHEN = 0).
  4. Program the appropriate source and destination addresses for the transaction into the channel’s DMASRCn and DMADSTn registers. For PIA mode addressing, use the base address value.
  5. Program the DMACNTn register for the number of triggers per transfer (One-Shot or Continuous modes) or the number of words (bytes) to be transferred (Repeated modes).
  6. Set or clear the SIZE bit to select the data size.
  7. Program the TRMODE[1:0] bits to select the Data Transfer mode.
  8. Program the SAMODE[1:0] and DAMODE[1:0] bits to select the addressing mode.
  9. Enable the DMA channel by setting CHEN.
  10. Enable the trigger source interrupt.