On 31-Jan-02 Stuart O'Reilly wrote: > 1/31/02 9:07:57 PM, Peter Onion wrote: > >>On 31-Jan-02 M. Adam Davis wrote: >>> There are plans for making a 16f84 into a 50MHz frequency counter using >>> the timer/counter port, so it has been done and it does work. >> >>DONT USE A 16F84 !!!!! >> >>The designs using 'F84s need some extra gates around them so that the value >>in >>the TMR0 prescaler can be discovered. You need to do this inorder to get at >>the least significant bits of the total count. >> > > I don't understand, I've used a 16F84 as a 50 meg counter and all I used was > a resistor (as shown in the app note) to find out what the TMR0 value was. Am > i missing > something? If you use the prescaler with TMR0 then the least signigicant bits of the count are contained in the prescaler counter which cannot be read directly. Inorder to discover the value in the prescaler you need to stop the external input, drive the external input under program control and count the number of pulses needed to get TMR0 to increment. Then you can work out what the value in the prescaler WAS when you stopped the external input. If you don't use the prescaler, then with a 50Mhz input, the maximum count of 256 in TMR0 gives an interrupt rate of 50,000,000/256 = 195312. On a 4Mhz 16F84 this is one interrupt every 5.12 cycles. I must be missing something because I can't see how this would work. Peter. ---------------------------------- -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads