Program the following registers to configure the DMA channels:
- Clear any outstanding interrupts and error flags
if possible (see IRQCLR in Section 13.9.1).
- The master control module Algorithm Select
register must be programmed to allow a DMA operation on the required
internal module, which enables the DMA/AHB Master clock, and keeps it
enabled until the clock is disabled by the host (see ALGSEL in Section 13.9.1).
- Channel n Control registers with channel bits
enabled (see DMACH0CTL and DMACH1CTL in Section 13.9.1).
- Channel n External address registers (see
DMACH0EXTADDR and DMACH1EXTADDR in Section 13.9.1).
- Channel DMA n Length registers. Writing this
register starts the DMA operation on the corresponding channel (see
DMACH0LEN and DMACH1LEN in Section 13.9.1).
- A complete operation is indicated by the result
available interrupt output or the corresponding status register. Clear the
interrupt after handling the interrupt (see IRQSTAT and IRQCLR in Section 13.9.1).
- Master control module algorithm-selection
register must be cleared to 0 to switch off the DMA/AHB Master clock (see
ALGSEL in Section 13.9.1).
Note: The IRQSTAT register must be checked for possible errors if bus errors can occur (which are typically valid in a debugging phase) in the system or in systems where bus errors can occur during a DMA operation.