View previous topic :: View next topic |
Author |
Message |
hello188
Joined: 02 Jun 2010 Posts: 74
|
Maximum frequency for Timer1 counter for 18F series??? |
Posted: Wed Aug 22, 2012 7:53 am |
|
|
Hi.
I am using counter to measure frequency which reflects some other analog quantity. Because I am using counter, if I make the input frequency range greater, a single bit error caused by the nature of counting pulses will be of less percentage of the whole range.
So, what I would like to know is, where in the datasheet I can find the maximum frequency that the timer1 module can accurately count from T1CKI pin? I looked at the timer1 section and DC characteristics section but could not find it.
Thank you. |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Wed Aug 22, 2012 8:52 am |
|
|
I found this in the 18Fxx2 data sheet, (electrical characteristics).
Quote: | Ft1 T1CKI oscillator input frequency range DC 50 kHz |
50kHz seems impossibly low to me.
Is it meant to be 50MHz?
All the other 18Fxxx parts quote the same value!
Mike |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Wed Aug 22, 2012 9:25 am |
|
|
Unless the input clock circuit is somehow dependent on the system clock for example to sample the input signal. I have run into things like that in the past where the "equivalent circuit" in the data sheet skips some of the important details. If the input to the clock is sampled along the same lines as a UART for example, then it could indeed be a low frequency. On the other hand, maybe they simply copied that part of the data sheet to the next one and nobody has noticed it (yet) :-)
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Wed Aug 22, 2012 10:40 am |
|
|
Microchip app note AN592 describes a 50MHz frrequency counter with a PIC16C5x, by feeding the unknown signal into the TMR0 input.
Seems strange that PIC18Fxxxs are limited to 50kHz.
The CCS sample code EX_FREQC.C works into the 10's MHz region with a lowly 16F877!
Mike |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Aug 22, 2012 11:02 am |
|
|
You're looking at the wrong parameter. You're looking at the Timer1
oscillator max freq. It's for a watch crystal.
For the external clock max frequency, look at "T1CKI input period".
Then convert that period to a frequency. |
|
|
gaugeguy
Joined: 05 Apr 2011 Posts: 303
|
|
Posted: Wed Aug 22, 2012 11:24 am |
|
|
You are confusing the oscillator circuit with the timer input circuit.
If you are connecting an external crystal to the timer 1 oscillator pins you are limited to 50kHz. If you are driving the Timer 1 input with an external signal you can get to 20 ns period (50MHz) with the right clock and precaler. |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Wed Aug 22, 2012 3:07 pm |
|
|
Quote: | So, what I would like to know is, where in the datasheet I can find the maximum frequency that the timer1 module can accurately count from T1CKI pin? I looked at the timer1 section and DC characteristics section but could not find it. |
It appears the answer to your original question is 50MHz.
All the data regarding high/low periods and oscillator frequency is all in the same table under electrical characteristics.
Mike |
|
|
|