Reliability of counting via interrupts on nrf52

Hello All,

Hoping to hear your opinion as I have little experience on how reliably the following would work.

The device should count pulses or edges from a reed switch in a reliable way and provide those values via BLE. Now apart from the obvious hardware debouncing challenge, I read about lost counts under some circumstance from people using the interrupts and wonder if this just a matter of implementation or simply hardware limits.

If concurrent counting and BLE communication is an issue, do you think a separate serial to parallel shift register, which the nrf could read out at regular intervals would work?

Thank you for your opinion on this

Kind regards

Barney

Parents
  • Hello Barney,

    At first, I thought about using PPI + a timer in counter mode for this. If you search for "PPI timer counter" here on DevZone you should see a bunch of tickets discussing the implementation of this. 

    However, it depends on the frequency of what you are trying to measure. If you need a debounce, the PPI approach will not work that good. Perhaps you want to look into the app_button library if you need a software debounce. If you have time for a debounce, then I think the app_button is probably sufficient. 

    So what is the frequency of the signal you are trying to measure? Are we talking 10Hz or 1MHz?

    Best regards,

    Edvin

Reply
  • Hello Barney,

    At first, I thought about using PPI + a timer in counter mode for this. If you search for "PPI timer counter" here on DevZone you should see a bunch of tickets discussing the implementation of this. 

    However, it depends on the frequency of what you are trying to measure. If you need a debounce, the PPI approach will not work that good. Perhaps you want to look into the app_button library if you need a software debounce. If you have time for a debounce, then I think the app_button is probably sufficient. 

    So what is the frequency of the signal you are trying to measure? Are we talking 10Hz or 1MHz?

    Best regards,

    Edvin

Children
No Data
Related