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

Requesting help using nRF52840 RTC Compare to generate SAADC TASKS_SAMPLE using PPI to workaround Errata 179

I would like further clarification on nRF52840 Errata 179: RTC: COMPARE event is generated twice from a single RTC compare match.

I am creating a sensor system that needs to take samples at precise times so that readings from multiple sensors can be evaluated as a group.

I operate LFCLK from a very precise TXCO and use RTC0 as the system clock to schedule activities.  I use several different RTC_COMPARE registers.  All of the compare match events generate interrupts which cause a short task to execute, then modify the RTC_COMPARE register to schedule the next event time.  One of the RTC_COMPARE events is connected to the SAADC TASKS_SAMPLE through the PPI.  The compare event causes the TASKS_SAMPLE, then the RTC_COMPARE register is written with a new value for the next sample time.

Does this errata suggest that if I write to the RTC_COMPARE register that is connected to the SAADC through the PPI that this may cause a spurious compare match that (in my case) generate an extra TASKS_SAMPLE?

Does this errata suggest that if I write to a different RTC_COMPARE register than the one used to generate the SAADC TASKS_SAMPLE that this may also cause a second compare match?

Is it possible that even a read of an RTC_COMPARE register may cause the second compare match event?

Can you suggest any work around specific to the usage described above that allows this operation to function properly?

  • As I interpret the errata, any access R/W to any of the RTC registers while the RTC triggers the COMPARE match event will trigger it twice. I also interpret it to mean that it is safe to access the RTC registers as long as you're done before the COMPARE match event triggers. 


  • Thank you for your response, but I don't understand your comment "that it is safe to access the RTC registers as long as you're done before the COMPARE match event triggers."  In my application, the compare event is periodic because I modify the RTC_COMPARE register so a new event will trigger in several hundred microseconds. 

    Unless you mean to tell me that it is safe to modify the register before the FIRST compare match event, but after that the event will trigger twice.

    I take it there are no further suggested workarounds.

Related