gnupic@linuxhacker.org

gnupic@linuxhacker.org


Subject: Re: pulse counting using timer1
From: Phil
Date: Mon, 5 Apr 2004 09:42:58 +1000

On Sun, 4 Apr 2004 08:06, Greg Hill wrote:
> Phil -
>
> I'm doing a project with tmr1 on the 876a as well. I've ported the code in
> the Microchip app note about implementing a frequency counter in software
> from the 16Cxx chip they used to the 876A I'm using.
>
> Your code looks good; I can't think of a reason why it wouldn't work.

Thanks for the replies Josef and Greg,

A couple of hours after posting my question I discovered the answer and that 
was to move the T1CON initialisation outside of the code enclosed by the 
STATUS instructions. Unfortunately I didn't notice that a reply to my own 
question returned to myself, and not the list, until after I'd logged off.

Now that the counter works I've found that the circuit is very sensitive to 
electrical noise. Turning on or off nearby appliances causes the count to 
advance, sometimes by hundreds and this is with the PIC circuit being battery 
powered and port C0 grounded.

I'll have a search for the frequency counter project.

-- 
Regards,
Phil.



gnupic@linuxhacker.org