Hi LeCrAm,
The line of code:
TCC0->EVCTRL.reg &= ~TCC_EVCTRL_EVACT0_Msk; // Turn off the action on event 0
does turn off the events to the timer. It's just that I made a mistake in the initial post, corrected it, but perhaps this was too late.
In any case, as you mention the line:
EIC->EVCTRL.reg &= ~EIC_EVCTRL_EXTINTEO2;
does the same thing, but further upstream, as it blocks the event passing through the External Interrupt Controller (EIC) instead.
I would like to output a 10KHz PWM signal on D20 with fixed small duty-cycle, until I get a variable fequency signal from D10 that will always be higher frequency than the 10KHz signal, lets assume 30KHz. I would like D20 to follow the falling edges of the 30KHz signal. I would like to change the duty-cycle in software.
The issue is that a 10kHz continuous PWM signal doesn't know when the next 30kHz input pulse is coming. If it arrives too late, the 10kHz signal could have finished its timer cycle and started on the next one.
Using oneshot gets around this problem, since once the oneshot pulse has ended, the timer cycle is effectively over until it's retriggered again.