The reality is that a PIC I/O's can be indeterminate on Power-On. Set the I/O's as one of the first things you do when you Power-On your PIC. Leaving them set to input (high impedance) may be enough to trip your circuitry.
The reality is that a PIC I/O's can be indeterminate on Power-On. Set the I/O's as one of the first things you do when you Power-On your PIC. Leaving them set to input (high impedance) may be enough to trip your circuitry.
Melainie, it is so nice to see you making posts again. We need you!
Charles Linquist
You know I can get to like some folks... *smiles* but seriously, don't get too excited... yesterday afternoon was an exception... I was in a meeting with people and a subject that bored the hell out of me... thank God for Wireless Laptops...
Hello,
Thank you for the answer.
About the pins status at power on, I read in the datashet that it is in undetermined state, as you say. I set PORTA in the program but it seems to be too late because the NE555 already got a logic HIGH from the pin by the time the PORTC register is written.
What is "tripping" a circuitry? (sorry if I sound ignorant).
That's why you add a pulldown resistor. That way as soon as you apply power, the line is already LOW.
'tripping' - As you've figured out, PIC's pins are INPUT at power up. If nothing is connected to them, or they are connected to something that isn't really 'connected' (i.e. another input to another chip), they'll float, meaning they just kinda hang onto whatever charge is floating around in the air, or maybe they'll get a bit of leakage from the pin next to them, or a bit of leaking across a couple of traces on the PCB...they'll end up doing whatever they want because there's nothing there to pull them either way....so, the charge might get high enough to register as a HIGH at the port latch itself....Orrrrrr....the charge might get low enough to register as a LOW at the port latch itself...Orrrr....it might hang out somewhere in the middle and just by accident get registered as a HIGH or a LOW just by hanging out. The key here is that it's 'Indeterminate', exactly what the books say... You just don't know what it's going to do, so you give it something to do, by adding a little push, a little bit of voltage to go either HIGH or LOW...
Thank you for this crystal clear explanation.
The datasheet is very clear too about the state of the pins at powerup.
I've tied the pin to GND with a 4.7K WPD resistor but still it would be HIGH at power-up.
I moved the PORT (setting it to 0) and TRIS (setting it to input) for this pin right at the top of my source code: it helped. Later in my code the PORT and TRIS registers are set to the right settings (my pin has to be used as output as it outputs a pulse).
Hope this helps others.
Bookmarks