cancel
Showing results for 
Search instead for 
Did you mean: 

Problem measuring two signals frequencies

Shlomi Weiner
Associate II
Posted on February 28, 2017 at 08:47

Hello everyone,I would like to measure frequency of two different signals using STM32Fxx timers'but i have problems setting two different timers to work simultaneously .thanks for your help.

8 REPLIES 8
Imen.D
ST Employee
Posted on February 28, 2017 at 12:22

Hello,

Please refer to the TIM examples available on the STM32CubeFx package, this will help you on how to use the TIM peripheral to measure the frequency.

Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on February 28, 2017 at 12:48

Thanks Imen.I have already did that, and succeed to measure frequency and duty cycle of one signal.

I can't succeed to do that for 2 signals simultaneously.

I try to use two timers peripherals(TIM3 and TIM4), but I have problem in setting both timers in my code.

Thanks.

Posted on February 28, 2017 at 14:16

Hi,

Which family device are you using ?

Could you please describe more your problem : if you have issue in the configuration of TIM3 and TIM4 to measure the frequency and duty cycle of the signal. Or your issue is in the start of TIM3 and TIM4 simultaneously?

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Shlomi Weiner
Associate II
Posted on February 28, 2017 at 17:03

Hi,

I am using STM32F407 device.

I succeed to measure frequency and duty cycle with  each timer separately. I have an issue in start of TIM3 and TIM4 simultaneously.(probably I write something wrong in my code).

Thanks a lot.

Posted on February 28, 2017 at 17:19

One could use a single timer pairing channel 1 & 2, and 3 & 4 to time stamp the edges of two input signals. Input Capture on a free running 32-bit TIM. Interrupting would limit upper frequency support.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on February 28, 2017 at 17:21

If the frequency and duty are different why wouldn't PWM Input suffice, why would the timers need to start simultaneously?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on March 01, 2017 at 13:33

Hi Shlomi,

You can share your code to check your configuration and identify what is going wrong.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on March 01, 2017 at 15:27

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6qi&d=%2Fa%2F0X0000000bwh%2FL7g.sBzVZo00pHAWuQFvhJX4VVhHMU_fdlAposKixUs&asPdf=false