gnupic@linuxhacker.org

gnupic@linuxhacker.org


Subject: Re: pulse counting using timer1
From: Phil
Date: Tue, 6 Apr 2004 14:46:37 +1000

On Mon, 5 Apr 2004 09:58, Laurence Withers wrote:
> On Monday 05 April 2004 00:42, Phil wrote:
> > 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.
>
> Have you decoupled the PIC? (A 0.1uF capacitor across the supply pins,
> located physically close to the chip, should do the job).

Thanks for the reply Laurence,

I had already tried adding 0.1uf capacitors to every likely place on the board 
without any noticeable affect. No doubt the problem is due to the prototype 
board that I'm using to test ideas. It's one of those boards that has a 
matrix of sockets for the components to plug into.

However, I hadn't tried adding a capacitor from the input pin to ground, as 
you suggested, because the counter advanced even with this pin grounded right 
at the PIC.

Anyway to make a long story shorter, I followed you advice and the counter now 
works perfectly! Now to move onto the next "insurmountable" problem.

-- 
Regards,
Phil.



gnupic@linuxhacker.org