PDA

View Full Version : Timer 1 external oscilator- Max Freq?



Desterline
- 14th October 2004, 09:41
I need to count pulses from a fast clock source (50 Mhz +). Obviously that's beyond what a pic can do without help. My plan (at least until I find a better one) is to run the clock through an external counter of sufficent width to divide the clock to something the pic can handle. Then I can just shft a few bits, read the external counter and reconstruct the real count.

But I need to decide how much counter I need, and that's dictated by how fast I can clock timer 1 in async mode, so...

If I'm correctly interpreting the datasheet for the 16F87xA, the T1CLK input period in async counter mode is 60 ns for the 'F' part and 100 ns for the LF.
So that's 16.6 MHz and 10 MHz right?

If I used an LF part at 5v, would it still be limited to the lower spec?


I'd be interested to hear about anyone else's experiences using timer1 near it's maximum speed.

Unless there's a better option I'm overlooking?

Thanks
-Denny

Dwayne
- 14th October 2004, 16:49
Hello Desterline,

Long time no hear...Great to see you again.

D>>I'd be interested to hear about anyone else's experiences using timer1 near it's maximum speed.

Unless there's a better option I'm overlooking?<<


Just for kicks, In Ham radio, we combine two frequencies, and get different results. the results we use to amplify and receive our original signal.

Could you inject a frequency into your 50 MHZ signal so that the result can be used by your PIC? Maybe a 49MHZ and use the 1 MHZ difference for the chip to capitalize on?

Dwayne

Desterline
- 14th October 2004, 17:42
Originally posted by Dwayne
Hello Desterline,

Long time no hear...Great to see you again.


I've been around, just not actively posting. Time's been in short supply the last few months.



D>>I'd be interested to hear about anyone else's experiences using timer1 near it's maximum speed.

Unless there's a better option I'm overlooking?<<


Just for kicks, In Ham radio, we combine two frequencies, and get different results. the results we use to amplify and receive our original signal.

Could you inject a frequency into your 50 MHZ signal so that the result can be used by your PIC? Maybe a 49MHZ and use the 1 MHZ difference for the chip to capitalize on?

Dwayne

Hmmm... Interesting possibility, but I don't think it'll work in this case. I'm actualy trying to time something very precisely. Basicly a super stopwatch. (10s of nanoseconds accuracy over ~5 minute period).

I don't realy see how to maintain the precision without actualy counting the higher frequency.

With such resolution and range it works out to about 40 bits of counter. I was hoping to keep the chip count low by doing the slower count on the pic. Right now it looks like one external four bit counter, 16 bits of timer 1 and a software counter beyond that.

50MHz /16 drops it to just over 3 MHz, but another part of the project needs one D-flipflop, I was thinking about spliting one off the counter to keep chip count low. The the pic would have to count ~6.25MHz. Doable, asuming I read the datasheet correctly :-)

But I'm open to better ideas...
-Denny

mister_e
- 14th October 2004, 22:05
CD74HC4059 : Divide by n counter is *suppose* to accept typ 54 MHZ Fmax if interpret datasheet the good way :)
have a look there

( http://focus.ti.com/lit/ds/symlink/cd74hc4059.pdf )

hope this may help you

Darrel Taylor
- 15th October 2004, 02:07
Take a look at Microchips Application Note AN592

Frequency Counter Using PIC16C5x

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011033

Supposedly this will work up to 50Mhz, although I haven't tried it myself.

I also assume it can be applied to a 16F876, since the timer0 modules are pretty much the same thing.

And, here's a link to a project where somebody applied AN592 to a 16F84.
http://digilander.libero.it/ik3oil/_private/Frequenzimetro_eng_2003.pdf

HTH,
&nbsp;&nbsp;&nbsp;Darrel