Frequency Divider using Prescaler on the Arduino Pin

I have a question which may not be possible or purely a figment of my imagination.

Basically I have a 60 Khz square wave, and I want to read the frequency with the PulseIn function on an Arduino digital pin. The readings I get are not that accurate.

Is there a way to scale down the frequency (divide) using prescalers or timers. I've seen some vague articles maybe saying this is possible although I don't fully understand the concept. At 1Khz the readings become more accurate.

Any help would be greatly appreciated

Vieri22:
I have a question which may not be possible or purely a figment of my imagination.

Basically I have a 60 Khz square wave, and I want to read the frequency with the PulseIn function on an Arduino digital pin. The readings I get are not that accurate.

Is there a way to scale down the frequency (divide) using prescalers or timers. I've seen some vague articles maybe saying this is possible although I don't fully understand the concept. At 1Khz the readings become more accurate.

Any help would be greatly appreciated

You could use an timer input capture. What Arduino are you using?

Readings not accurate.... Describe a bit more precise. Post a wiring of the setup. What does the output generating the 60kHz look like?

Generally you loose resolution when you divide, unless you add decimal places.

Is there a way to scale down the frequency (divide) using prescalers or timers.

My "intuition" tells me that software solutions won't help unless you need to "smooth" or average the readings. A hardware frequency divider in front of the Arduino might help, depending on the cause of the inaccuracy. But again, you're actually loosing resolution.

Maybe one of these libraries would be useful. They do work great (I tried them) and you'll get very accurate results.

FreqCount: best for 1 kHz to 8 MHz
FreqMeasure: best for 0.1 Hz to 1 kHz

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.