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

COUNTING THE NUMBER OF PULSES

I am generating a pwm signal in pin no:21 of nordic nrf51422 board. i connect this pin to pin no:24 using a wire in the same board and want to count only rising pulse edges (not frequency). is it needed to use ppi here or only pin change interrupt works here.If there is any code related to count possitive pulse edges please share.

Parents
  • Hello ANKITTY

    I recommend you look at this post

    In your case you would only need one GPIOTE pin configured to generate an event on LowtoHigh, and connect that to a timer set in count mode via PPI. You could then use a timer to trigger an interrupt to read out the number of pulses registered per unit time.

    Best regards

    Jørn Frøysa

  • PPI is a way to connect two hardware peripherals without involving the CPU core. This allows for faster interaction between the peripherals, and adds autonomy. This way the CPU core can focus on other things (such as maintaining the BLE connection) while the hardware peripherals are working. That way you reduce the amount of CPU time you need to dedicate to the task the peripherals are performing.

Reply
  • PPI is a way to connect two hardware peripherals without involving the CPU core. This allows for faster interaction between the peripherals, and adds autonomy. This way the CPU core can focus on other things (such as maintaining the BLE connection) while the hardware peripherals are working. That way you reduce the amount of CPU time you need to dedicate to the task the peripherals are performing.

Children
No Data
Related