cancel
Showing results for 
Search instead for 
Did you mean: 

frequency capture

madhu13
Associate II
Posted on January 10, 2011 at 13:03

frequency capture

14 REPLIES 14
madhu13
Associate II
Posted on May 17, 2011 at 14:20

thank you mr.clive1, i will test my code clearly once and get back ..thank you for your support

Regards

Madhuri....

cjaggers
Associate
Posted on May 17, 2011 at 14:20

Hi  Ulasandra,

I am also trying to do something like this with a signal from 0 to 100Hz and I wanted to know if you had any luck getting this to work like you wanted.

I would appreciate any tips or suggestions that you might have.

Thanks
Posted on May 17, 2011 at 14:20

First one must note that this method does not measure frequency, it is measuring the PERIOD of a SINGLE CYCLE, and extrapolating it over ONE SECOND. This is particularly prone to issues with synchronization/granularity/quantization/jitter. You really need to average/filter over several measurements to mitigate these somewhat.

The higher the frequency, the higher the interrupt load on the processor. I don't see 100 Hz being an issue.

Are the frequencies you want to measure constant, modulated, accelerating, decelerating, etc?

Another method is to use encoder/counter mode, and periodically measure it. Say once a second for frequencies below 65 KHz.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
cjaggers
Associate
Posted on May 17, 2011 at 14:20

The value can change from ~2Hz to 100Hz at any point, I will look into the encoder stuff. I just setup my board to monitor my encoder on my motor for me instead of doing my own interrupt routine so I know a little about what you are talking about, I will see if I can figure out a good way to use the encoder counters. Thanks for the direction.

madhu13
Associate II
Posted on May 17, 2011 at 14:20

hi, in my application i have to capture the frequency and based on the frequency information i have to

decide

the sampling time of timer... i will be knowing the number of samples 2 cycles..i have to calculate the sampling time so that the signal i read should be of 2 cycles....how can i do this is there any formula to calculate the same... i tried this formula

sampling count =

((captured count *2)/number of samples)*(capture timer clock/sampling timer clock)