I am having a very strange problem with timers and the PPI channels.
I am trying to take a fixed number of ADC samples at 1 ms intervals starting at a fixed offset in time from the occurrence of an interrupt. I set a PPI channel to start Timer 1 when the interrupt pin goes high. There is a second PPI channel tying Timer 1 compare event 1 to the start task of Timer 2.
Timer 2 has a compare event at 1 ms with a PPI channel tied to the ADC start task and a short to clear the timer and thus reset.
This all works fine, and I get my samples. The problem is that I am not able to stop Timer 2. I tried using a PPI channel to another compare event on Timer 1 set to the end time for the samples and tying this to the Stop task for Timer 2, this is how I would like it to work. I also tried using the ADC End event for this PPI channel. I know I am getting the events, I have an interrupt handler with some debug messages to validate this but Timer 2 never stops.
Could the clear short on the Timer 2 event be preventing this timer from being stopped? That doesn't make a lot of sense to me but I can't think of any other explanation.
If needed I could post some code but I would have to simplify it to show just this sequence of events.
Thanks,
Ted.