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

Measuring elapsed microseconds between 12 successive rising edges on 12 GPIOS on NRF52832 DK

Hi everyone,

I'm new with nrf52832, and I need to measure elapsed time in microsecond between rising edges of 12 different Gpios. I have 12 piezoelectric sensors filtered, amplified, getting a 0V-3.3V Logic level in input. Once one of these senors rises up, I need to start counting microseconds and store corresponding elapsed microsecond until I have 11 different values (assuming the first sensor's timing is 0). And then posting it over ble.

I red some documentations, and I heard about Timeslot API, timers and sys_tick, but I don't know which one would be better for my application.

Would you have any idea about how should I take this ?

Thanks for your help, and have a good day !

Parents
  • Hi,

    Have you considered using PPI? It is possible to have the Logic level input start a timer and a counter automatically. I'm not sure if I understand your use case, but it is e.g. possible to start a timer on the first Logic level event, then use a counter to count 11 logic level events, and finally stop the timer on the 11th event. All this can be done autonomously without using the CPU, Timeslot API, or sys ticks. The CPU can even be sleeping while you time your events. On the 11th event you can chose to trigger an interrupt to process your timer value. I wrote a little bit more about PPI at the bottom of this thread.

  • Hi

    Thanks for your answer ! I looked at PPI but it seems like there is only 6 configurable groups. It takes me a bit of time to understand all of the concept of this but can I attach 12 inputs to PPI ? I'm working on it ! Thanks for your help :)

Reply Children
No Data
Related