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

PPI time stamp accuracy problem

Hi all!

I've been working on a firmware to timestamp GPIO events using PPI in nRF52, and it works:

github.com/HiveTracker/firmware (more context: hivetracker.github.io)

So first off, thanks for those who participate in this great forum, it helped a lot for this project (timer sync trick + feasibility question).

...but now there's a surprising accuracy problem, and maybe some of you have suggestions.

Apparently, GPIO events are sampled at 16MHz by the PPI, so the timestamps should not have more than 62.5 ns errors.

But in the following picture, you can see an example where a pulse width is measured, the value is printed on a serial port, and there is a 200 ns error (= 0.2 ms = 21.31 us - 21.11 us). 

Would anyone happen to have a clue about why this PPI timestamp is so inaccurate?

If it can help, here is the repo that was used to do this test: github.com/HiveTracker/PPI

Thanks a lot!!

Cedric ;)

Notes:

- this measure was done at 100 MHz with a Saleae logic analyser, so it should be good

- the GPIO are not initialized in low accuracy mode (they use the same configuration as for the high_accuracy mode)

- the microseconds conversion is computed as a float so it should not be a problem

- the cables are fairly short so the electronic system should not be the problem

Related