This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can RTC instances run synchronized i.e. same counter value?

Suppose I configure RTC0 and RTC1 to have the same LFXO clock source (with a 30uSec tick) and start them in quick succession. Will their counters read the same value?

I could experiment, so I am asking whether someone has already done this, on Nordic or any other platform. Just reading the documents under "TASK and EVENT jitter/delay" doesn't seem to answer the question, for me.

My best guess is that two different RTC instances would count in unison since they have the same clock, but that sometimes when started in quick succession their counters would be in lock step, but other times when started they would differ by one (depending on exactly when they were started on the cpu clock in relation to the LFXO clock.)

But maybe I could rig the PPI to start two RTC instances exactly in lock step?

The context is, I need two timers. Currently I am using two compare registers on the same RTC (so I know they are comparing to the same counter value.) But then the ISR for the clock needs to dispatch on events (the compare events interrupt through the same RTC0 vector.) I am reading about Rust cortex-m-rtfm RTFM, where each task is associated with a separate interrupt vector, and I want to use a separate RTC instance for each timer because the RTC instances each have their own interrupt vector, but I want the instance counters to be in unison on the LFXO clock.

Parents Reply Children
No Data
Related