I have set OPTION_REG.7 = 1 and it dosn't help, the port still stays high once I've had an input on it.
Turns out that it's my delay rutine
Code:
void delay10( char n) //delay10( 100); /* 1 second */
/*
Delays a multiple of 10 milliseconds using the TMR0 timer
Clock : 4 MHz => period T = 0.25 microseconds
1 IS = 1 Instruction Cycle = 1 microsecond
error: 0.16 percent
*/
{
char i;
OPTION = 7;
do {
clrwdt(); // only if watchdog enabled
i = TMR0 + 39; /* 256 microsec * 39 = 10 ms */
while ( i != TMR0)
;
} while ( --n > 0);
}
If I disable a call to this function that is being called from my Running_Led() function it all works, except for the fact that there's no delay in the lights being turned off and on, so they look like they are all turned on at the same time, when in fact they are turning on and off faster than I can see it.
I think it has something to do with the OPTION = 7, but I am not totally sure.