Time Interval In STM32

titanif

New Member
I want to set the Timer/Counter of STM32 as such that it(timer) should START by the external trigger on one GPIO pin and should STOP by another GPIO pin of the STM32. After stop I want to have the value of counter OR the time elapsed from START pulse to STOP pulse. Basically I have two pulse signal and I want to measure the delay between them using only STM32.
Any help would be appreciated.
 
I'm not familiar with that specific device family, however it appears to have an "Input capture" facility.

You can leave the associated timer free-running at a suitable frequency, then configure two input capture units to the two input pins & the appropriate high or low going edges.

Wait until the second it triggered & subtract the value from the first capture reg, from the second one, to get the interval in timer units.

More info:

 
These materials may be useful to you.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…