PDA

View Full Version : Strangely behaving 16F877a



financecatalyst
- 15th October 2009, 00:07
Hi
I am using an external oscillator 4MHz. My program simply toggles one pin every 30ms.
Problem is that I see sometimes the toggling if I touch the PIC,leg of the capacitor (earth) or touch the bench the circuit is left on and sometimes it works fine and sometimes the led is just on constantly.

What could be the reason for this???

Archangel
- 15th October 2009, 05:39
Hi
I am using an external oscillator 4MHz. My program simply toggles one pin every 30ms.
Problem is that I see sometimes the toggling if I touch the PIC,leg of the capacitor (earth) or touch the bench the circuit is left on and sometimes it works fine and sometimes the led is just on constantly.

What could be the reason for this???
My first impulse would be stray capacitance. Pins should be pulled high or to ground with resistors and never left floating.

financecatalyst
- 15th October 2009, 10:37
My first impulse would be stray capacitance. Pins should be pulled high or to ground with resistors and never left floating.

You mean all the remaining 36 Pins? If you do then please can you also advise me suitable values:).
Thanks

comwarrior
- 22nd October 2009, 01:03
any resister from 1K to 100K... anything to pull the pin to ground...
You could just wire them straight to ground, but you need to remember to set all the pins to input...

financecatalyst
- 22nd October 2009, 02:30
thanks for the input to all. The problem was that my MCLR pin was not made high and was left floating. Its working now.