STM32F4 TIM Frequency and Delay Measurement
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-11-05 11:35 PM
Posted on November 06, 2015 at 08:35
Is it possible to solve this problem with a hardware timer?
I have the following Problem:
I have two input signals. The frequency of the signals is equal, but there is a delay between this signals. I have to measure the delay between the rising edge of the first input and the rising edge of the second input. I have also to measure the frequency of one Signal. I'm using the STM32F429. Example:
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-11-07 1:03 PM
Posted on November 07, 2015 at 22:03
This is almost the same as measuring pulse width of PWM - see the PWM input sub-chapter of TIM chapter. The only difference is that you don't set capture2's source to channel 1, but each channel captures its own ''native'' input.
JWOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-11-08 2:52 AM
Posted on November 08, 2015 at 11:52
This is one of the most basic examples of input captures possible. Configure a timer of your choice with a certain base time with a precision in range (so at least something as high as the highest possible delay time).
Choose two input channels (most timers have ~4) and configure them for input capture. Activate the interrupt of the channel which triggers the delayed signal and then compare the CCR registers of both channels for the actual delay.