cancel
Showing results for 
Search instead for 
Did you mean: 

frequency capturing

prabk4u2004
Associate II
Posted on May 26, 2014 at 09:18

dear all,

i am developing the project with the name frequency module, here i am trying to capturing the frequency from 10 hz to 999hz , i am facing some error in the capturing , if i give constant freq it varies with the 2 hz of tolerance, if i try to solve that , it will affect in higher range of frequency, i kindly request you all to help me regarding this 

regards sowmya

#fsm #fsm
3 REPLIES 3
Posted on May 26, 2014 at 21:11

Which STM32 part? How are you measuring it now? What settings on the timer?

Use a 32-bit timer, clock it as fast as possible.

Use Input Capture, or PWM Input mode.

For frequency you can also use the IC prescaler.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
prabk4u2004
Associate II
Posted on May 27, 2014 at 07:45

dear Clive

Thank you for the response ,part no is STM32F103RCT7 the configuration of the timer and its details will be found in the attachment plz go through it and do the need ful

________________

Attachments :

FSM_Final_Code28_2014-05-26_VER2.0.rar : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I00m&d=%2Fa%2F0X0000000bS9%2FIYYET.69yT17zdVSaJbAGNNDcerOrj0N99Vl2dXt3C4&asPdf=false
Posted on May 27, 2014 at 18:18

There is far too much to wade through there. The pin/tim connectivity is not well described.

I will observe that a 16-bit count wraps at 65536 not 65535.

I would use the interrupt on the slower (slave) timer, and I would be sure to clear the interrupt that I was servicing.

If you can use one timer with 2us (500 KHz) ticks, you could measure a period between 1-100ms with that accuracy.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..