44.6.4.1 DMA Operation
The TCC can generate the following DMA requests:
- Counter overflow (OVF)
- If the One-shot Trigger mode in the control A register
(CTRLA.DMAOS(CTRLA<23>)) is written to '0', the TCC generates a DMA
request on each cycle when an update condition (Overflow, Underflow or
Re-trigger) is detected.
When an update condition (Overflow, Underflow or Re-trigger) is detected while CTRLA.DMAOS(CTRLA<23>)=1, the TCC generates a DMA trigger on the cycle following the DMA One-Shot Command written to the Control B register (CTRLBSET.CMD(CTRLBSET<7:5>) = DMAOS).
In both cases, the request is cleared by hardware on DMA acknowledge.
- Channel Match (MCy)
- A DMA request is set only on a compare match if CTRLA.DMAOS(CTRLA<23>)
= 0. The request is cleared by hardware on DMA acknowledge.
When CTRLA.DMAOS(CTRLA<23>) = 1, the DMA requests are not generated.
- Channel Capture (MCy)
- For a capture channel, the request is set when valid data is
present in the CCy register, and cleared once the CCy register is read.
In this operation mode, the CTRLA.DMAOS bit (CTRLA<23>) value is ignored.
DMA Operation with Circular Buffer
When a CC0 channel is selected as a circular buffer, the related DMA request is not set on a compare match detection, but on start of Ramp B.
If at least one circular buffer is enabled, the DMA overflow request is conditioned to the start of Ramp A with an effective DMA transfer on previous Ramp B (DMA acknowledge).
The update of all circular buffer values for Ramp A can be done through a DMA channel triggered on a MC (Compare Match) trigger. The update of all circular buffer values for Ramp B, can be done through a second DMA channel triggered by the overflow DMA request.
When CC0 channel is selected as a circular buffer, the related DMA request is not set on a compare match detection, but on start of down-counting phase.
If at least one circular buffer is enabled, the DMA overflow request is conditioned to the start of up-counting phase with an effective DMA transfer on previous down-counting phase (DMA acknowledge).
When up-counting, all circular buffer values can be updated through a DMA channel triggered by MC (Compare Match) trigger. When down-counting, all circular buffer values can be updated through a second DMA channel, triggered by the OVF DMA request.