Quote Originally Posted by xnihilo View Post
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...