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.
Posted on September 22, 2017 at 23:14 hi i need start timer with external pulse at falling edge at one pin and i need stop timer with external pulse at falling edge at one pin can convert two 16 bit timer to one 32 bit timer ? on stm32f103c8t6 my timer clock is 72Mhz what can i do ...