PDA

View Full Version : Maximum frequency count on 16F628/4MHz



solara
- 18th May 2005, 14:04
Whats the maximum physical frequency that can be counted on a 16F628 using a 16F628 (using 16 bit TIMER1 as a pulse counter)?

Is this limited by the minimum rise and fall times for the 16F628.
Anybody know what the practical/theoretical limit is?

solara
- 18th May 2005, 14:12
I should have mentioned this is an external asynchronous clock signal, which is being measured.

Melanie
- 18th May 2005, 16:51
Datasheet, Table 17-7, Parameters 45, 46 & 47. These values are independent of actual Processor Clock Speed.

solara
- 20th May 2005, 14:50
For an asynchronous external clock on a 16F628
45=30ns
46=30ns
47=60ns

This doesnt help me as there is no specified minimimum rise and fall times.
And from the figures above 45+46+rise+fall=47.

solara
- 20th May 2005, 14:56
Is this saying that the maximum external asynchronous clock frequency is 1/60ns =16 MHZ?
Sounds far too low.

Melanie
- 20th May 2005, 19:31
That's what it's telling you. If you don't believe it, take a signal generator and run a test. The PIC isn't exactly a speed demon.

Darrel Taylor
- 21st May 2005, 18:02
Hi solara,

You had specified Timer1, which is slower than Timer0.

If you use Timer0, you can measure up to 50Mhz, even with a 4Mhz osc.

Using the Prescaler, it actualy works like a 16-bit Counter. It's a little tricky to get the lower 8-bits. But it can be done.

Check out AN592 from Microchip
AN592: Frequency Counter Using PIC16C5x (http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011033)

HTH,
   Darrel

solara
- 23rd May 2005, 08:59
Thanks Darrrel,
Thats what I wanted to hear.

solara
- 23rd May 2005, 09:37
Looks like TMR0 is still bound by the same limits as TMR1 on 16F628 (according to datasheets).
Also the AN592 doc is only for PIC 16CXXX, which can measure up to 50MHZ.

solara
- 23rd May 2005, 09:44
Just had another more detailed browse at the 16F628 sheets, and see that with prescaler the high and low pulse widths are min 10ns. Implying period=20ns = 50MHZ.

Thanks everyone.

Acetronics2
- 23rd May 2005, 10:38
Hi, solara

It works ...

Alain