how may I calculate the maximum frequency

Thread Starter

micropad

Joined Dec 24, 2011
75
Dear All
Please kindly teach me how may I calculate the maximum frequency that can be count using Timer0 and Timer1 in Counter mode (Timer1 in Asynchronous Counter mode)
Any equation highly appreciated
PIC is 16f877a
Thanks in advance
 

ErnieM

Joined Apr 24, 2011
8,041
Two symbols Microchip uses you should know are Fosc and Tcy.

Fosc is the clock frequency your crystal runs at.

Tcy is the time to run a single instruction.

And for PICs:

Tcy = 4/Fosc


What is your clock frequency?
What prescaler value are you using?
 
Last edited:

Thread Starter

micropad

Joined Dec 24, 2011
75
Two symbols Microchip uses you should know are Fosc and Tcy.

Fosc is the clock frequency your crystal runs at.

Tcy is the time to run a single instruction.

And for PICs:

Tcy = 4/Fosc or Tcy = Fosc/4


What is your clock frequency?
4MHz
What prescaler value are you using?
Timer0 256

Thanks for reply
 

ErnieM

Joined Apr 24, 2011
8,041
If I'm reading Table 17-6 correctly....

Timer0 needs to meet items 40,41 & 42, so hi and low period of 10nS min each, and a min period of 20nS. That's 50 MHz for a square wave input..

Timer1 needs to meet items 45,46 & 47, so hi and low period of 15nS min synchronous and 25nS asynchronous, and a min period of 30 or 50 nS. That's 33.3 MHz or 20 MHz for a square wave input.

Item 47 saying a max of 200 kHz for Timer 1 is only when using the external oscillator on that module, not for driving with an externally generated signal.

These high to me but how I interpret the data sheet.

(I now believe I got this incorrect. See post http://forum.allaboutcircuits.com/showthread.php?p=451348#post451348)
 
Last edited:
Top