Increase timer resolution

Thread Starter

samjesse

Joined Sep 14, 2008
212
Hi
With AVR uC, if timer's prescaler trades resolution for duration.
What way is used to trade duration for resolution much higher above the frequency of the uC?
I am imaging running more than one timer in an off-sync.

Many Thx
 

THE_RB

Joined Feb 11, 2008
5,438
There's no easy way, because the timer is driven from the micro's oscillator.

What are you timing?

The best/easiest method is just to time multiple contiguous events, the resolution scales up with the number of events tested.

My high resolution capacitance meter project here;
http://www.romanblack.com/onesec/CapMeter.htm
increases the resolution by timing multiple contiguous periods until the total timer count is > 2 million. So the recorded period resolution is as low as 0.5 parts per million.

Basically it's a high resolution timer that times the periods of a capacitor oscillator.
 

Papabravo

Joined Feb 24, 2006
21,228
The best way is to combine the longest possible hardware timer with an appropriate number of software words to produce a high resolution long count timer.
 

THE_RB

Joined Feb 11, 2008
5,438
Hi Papabravo, how does that give a greater resolution than the native timer count frequency?

From my understanding you need to either increaase the timer count frequency and/or time multiple contiguous periods.
 

Papabravo

Joined Feb 24, 2006
21,228
It doesn't. I only meant to suggest that, to time reasonable length intervals with the best resolution available in the hardware you need to extend the length of the hardware timer with software.
 

Potato Pudding

Joined Jun 11, 2010
688
You can use a higher speed external oscillator with an external counter IC.

74FCT191 can handle a 100Mhz clock. Use that as an external prescale counter.

If you can freeze the count then you can capture the value of those 4 bits and you can append them to the internal counter to define an 16x higher resolution.

But it is much simpler to go with some MCU that uses a fast clock and 32 bit counters.

PIC32

ARM

Many choices.
 
Last edited:

THE_RB

Joined Feb 11, 2008
5,438
It doesn't. I only meant to suggest that, to time reasonable length intervals with the best resolution available in the hardware you need to extend the length of the hardware timer with software.
My apologies Papabravo, it was a misunderstanding of your word use. :)

To me, to "time" an interval referred only to measuring its time with the micro. I missed the point you were making about generating a timer interval and assumed the OP wanted to measure time periods, not generate them.
 
Top