>It looks surprisingly complicated. It looks like the frequency stream
>is enabled and disabled by the chip. Wonder why?
Terry is doing a very interesting thing: the TMR0 input is rated to at least
50 MHz. By assigning the prescaler to TMR0, he can accumulate a number of
counts in a given period in TMR0 and the prescaler. But the prescaler is
not readable or writeable from within the pic. So - what he does is disable
the external frequency input, store the TMR0 value somewhere, then generate
and count his own pulses into the TMR0 input until TMR0 increments. Now he
can figure out what the count was in the prescaler - that plus TMR0 gives
him a 16 bit count value for gate time. Nice, simple, ingenious!
> >It looks surprisingly complicated. It looks like the frequency stream
> >is enabled and disabled by the chip. Wonder why?
>
> Terry is doing a very interesting thing: the TMR0 input is rated to at least
> 50 MHz. By assigning the prescaler to TMR0, he can accumulate a number of
> counts in a given period in TMR0 and the prescaler. But the prescaler is
> not readable or writeable from within the pic. So - what he does is disable
> the external frequency input, store the TMR0 value somewhere, then generate
> and count his own pulses into the TMR0 input until TMR0 increments. Now he
> can figure out what the count was in the prescaler - that plus TMR0 gives
> him a 16 bit count value for gate time. Nice, simple, ingenious!
And exactly as per a certain Microchip App not that's been around since
1995 at least. Ok, the printed version in the 1995 databook had some small
mistakes but it was there. I think it was signed by M. DeSouza from
Microchip..
> On Sun, 25 Oct 1998, Dwayne Reid wrote:
snip
> that plus TMR0 gives
> > him a 16 bit count value for gate time. Nice, simple, ingenious!
The counter diplays 7 digits, 16 bit is not enough
It uses 24 bits
AND
Peter L. Peres wrote:
> And exactly as per a certain Microchip App not that's been around since
> 1995 at least. Ok, the printed version in the 1995 databook had some small
> mistakes but it was there. I think it was signed by M. DeSouza from
> Microchip..
I only made a couple of fixes and ported the code to 16x84
But the orignal article was published in November 1994
I am still getting request for the code/circuit
so I will say again
The code/circuit is available from Bob Blick's site
www.bobblick.com/bob/projects/freqlcd.zip
The hex, asm and circuit gif it's zipped and is 76K bytes
And that the kit is availble from http://www.weedtech.com/
all parts including lcd and pcb for $46 (I think)