Cancel / Disable TIMER COMPARE Event

Hi,

With nRF5340 DK, I am using CC registers of NRF_TIMER2 (as a free-running Timer), and DPPI, interacting with Radio.

I set up a Timer Compare (functioning as a timeout).
I want to cancel the Timer Compare if a Radio Address Event occurs.
Ideally, I want to cancel the Timer Compare at the hardware level, so probably with DPPI.
So that the Radio Address Event would trigger a Task to cancel the Timer Compare.

Maybe I am missing something, but I don't see a readily obvious way to do this.
I don't want to clear or pause the Timer.
The only DPPI Task which acts on a Timer CC Register is the Capture Task.

So I tried that.

When the Radio Event occurs, I do a Timer Capture Task (via DPPI) into the same CC Register I am using for the Timer Compare.

You would think, this is the worst thing to do - that it would immediately trigger the Timer Compare Event that I am trying to cancel.
In fact, it doesn't ever seem to trigger a Timer Compare - ever.  It's as if when you explicitly write in the current time
into a CC Register that has been set up to do a Timer Compare, the Timer doesn't see the match in time, and misses the Compare.

Now, a free-running Timer would still eventually wrap around and trigger a Timer Compare Event - but the software intervenes and re-sets things,
long before that can happen.

It exactly serves my purposes:  the immediate Timer Compare is missed, effectively cancelled, and the software can go in afterwards and do any cleanup work.

It's nice to be able to cancel the Timer Compare at the hardware level, using DPPI - it makes for tighter, more reliable timing.

I am just wondering what you think of such a solution, or if there is a more standard one that I am missing.

Thanks
Tommy Schell

Related