Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.
 

Latest threads

New Articles From Microcontroller Tips

Back
Top