Matt wrote:
 
 Using a prescaler reduces accuracy
 but would let you count at a higher frequency. Using a 8bit
 timer instead of a 16 bit timer is more accurate.
 
Hi Matt!

The plan is to use a 12f1572. According to the datasheet, both TMR1 can count 
up to 16,666MHz without or 33,333MHz with internal prescaler. To count the max. 
prescaled frequency, core clock must be 32MHz with prescaler=8.

TMR0 can handle shorter pulses, but the period is like for TMR1 defined as 
"Greater of: 20 or (Tcy + 40)/prescale value". Min Tcy is 200ns, so the second 
term can never go below (240/8=) 30. This may be a datasheet error, but the way 
it is written it won't count faster than 33,333MHz.

If you're counting, say, 10000000Hz or 10MHz, a prescaler value of 8 introduces 
a possible error of -7Hz, because there may be counts left in the prescaler 
which cannot be read. The internal oscillator is to be used as reference with 
+/-2% of accuracy, or +/-200000Hz. Even when using a crystal with +/-15ppm, the 
reference introduces a possible error of +/-150Hz. Therefore, when it comes to 
higher frequency, I'd say the prescaler error can be accepted. When the 
frequency appears to be low, the prescaler can be switched off.

I can't imagine however why using an 8-bit counter should be more accurate.

Greets,
Kiste

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/jallib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to