Hi all!
TL;DR
Is there a way to start 2 timers in 1 instructions? (or to synchronize them afterward?)
- - -
Background
I need to take 8 timestamps of GPIO edges using PPI events/tasks (more explanations here).
This needs 2 timers as they don't have more than 4 (or 6) capture registers each.
To have coherent timestamps, the timers should start simultaneously, and I'm looking for a good way to do it.
- - -
1st idea
It seems unlikely that a simultaneous start is possible as they have different register addresses, ex:
TIMER1: 0x40009000
TIMER2: 0x4000A000
But as they are running at 16MHz and the core runs at 64MHz, it might not be impossible that the 2 start request happen simultaneously:
nrf_timer_task_trigger(NRF_TIMER1, NRF_TIMER_TASK_START); nrf_timer_task_trigger(NRF_TIMER2, NRF_TIMER_TASK_START);
Should I use a PPI event to reset both timers in the same time? (it seems complicated but maybe the most appropriate)
- - -
2nd idea
Maybe there's a reliable way to check that the 2 timers are synchronized, and if not, copy the value of one in the other?
- - -
Does anyone have any suggestion?
Thanks a lot!
Cedric ;)