This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Parallel time-stamps of GPIO edges with PPI? (timer capture)

Hi, all!

Is it really possible to timestamp 4 GPIO edges in parallel with the nRF52?

It would need to be as fast as possible and some edges might be simultaneous so PPI seems to be the trick.

The documentations (PPI, GPIOTE, GPIO, TIMER) as well as these Nordic tutorial and repo give some good hope, but it's not completely clear if it can really be parrallel.

If it is, would anyone have any other example repository, tutorial, or suggestion to tackle this problem?

Also, is it right to say that the GPIO shortcut register (doesn't seem to exist) can't be connected to the TIMER shortcut register (doesn't seem to do any capture)?

So the best granularity for these timestamps would be 16MHz (62.5ns), right?

Finally, would there be any potential conflict with the soft device?

Thanks a lot for reading all of this!

Cedric ;)


PS: some of you might suggest using the cypress FPGA+MCU+BLE but it's not as power efficient so it would only be a last resort...

  • You can easily do that :

    • Configure your GPIO to generate events on each rising (or falling or toggle) edge through register CONFIG[n]. You can have up to 8 pins generating events on nRF52840.
    • Configure the timer in counter mode and start it.
    • Through PPI connect each pin event to a capture channel task of your timer. You have 6 capture register on nRF52840.

    Then every time a pin receive the correct edge, the capture register connected to it will latch the current timer value. All this events can happen at the same time or not, it doesn't matter.

    Good luck :)

  • Great! Little note: that's probably a kind of typo but the "Counter register is incremented by one each time the COUNT task is triggered": infocenter.nordicsemi.com/index.jsp So the most appropriate to time-stamp the GPIO edges is probably the timer mode ;) Thanks a lot for your answer!!

    PS: In our case we need to time-stamp 4 rising edges + 4 falling edges, so the trick is to use 2 timers as there are not enough otherwise ;)

Related