2011-01-10 04:03 AM
frequency capture
2011-05-17 05:20 AM
thank you mr.clive1, i will test my code clearly once and get back ..thank you for your support
Regards
Madhuri....
2011-05-17 05:20 AM
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. Thanks2011-05-17 05:20 AM
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.2011-05-17 05:20 AM
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.
2011-05-17 05:20 AM
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)