13.4.3 DMA Trigger Sources

Each DMA channel can select from the hardware triggers to initiate a DMA transfer. The trigger sources are generally device-level interrupts from peripheral modules, as well as the external interrupts and interrupt-on-change sources. The CHSEL[7:0] bits (DMAxSEL[7:0]) select which interrupt (and thus module) is used as a trigger for a particular DMA channel (see Table 13-2). The CHSEL bits may change at any time to select another module to service. However, it is not recommended to make a change while the associated DMA channel is in operation. A DMA channel can be configured to service any memory-mapped peripheral, regardless of the trigger’s origin. This is because the trigger (interrupt) source is independent of the DMA source and destination addresses. For example, a DMA channel configured to respond to the INT0 interrupt could be used to move data into or out of a UART FIFO. In most cases, it makes more sense to use a peripheral’s own interrupt for performing a data transfer. However, there are also many cases where it is desirable to use one peripheral interrupt to perform a DMA operation on another peripheral – perhaps even another DMA channel. Examples of such operations are provided in Application Examples. In addition, a DMA channel may be triggered in software by setting the CHREQ bit (DMAxCH[4]). This allows for an application to use the DMA Controller to move data directly, without having to wait for a hardware interrupt. CHREQ is also set when a hardware trigger occurs.