AnsweredAssumed Answered

Measuring the time duration between two pulses

Question asked by prieur.jean on May 23, 2013
Latest reply on Apr 15, 2016 by FTITI.Walid

I want to do something "simple": measuring the time duration between two button presses. In my application, the user can press a button repetitively and the STM32F4 will calculate the time between two pulses to determinate the average frequency. The range of time will go from 200ms to 2s.

I think I should create an interrupt on a GPIO input, and count with a timer the time passed between two interruptions ? Is it the best way to achieve that ? Or do you have some code for me :)

Thanks !