Portc problems

Started by seicento9999 March 5, 2004
Hello All
On the 16f873 I am using, portc bits 0 and 1 are used for diagnostic
leds. Each pin has a dropper resistor and led to ground. The port is
set up as an outputs apart from bits 3 and 4 which are used for I2C
comms.
One led is set up to flash every time the program executes a full
scan and the second led flashes each I2C communication. There are 18
slave 16F873's and one master 16F877.
Communication to all slaves is done every second. The slaves handle
the I2C comms under interupt control.
The problem is that after a few days one led goes off and stays off
the other led is faintly lit.
The code executes fine and the comms works fine it's just these leds
go off/dim.
Pressing the reset restores the led function.
I have tried re writing to TRISC every scan this has no effect.
A full system reset every few hours obviously works but this
sledgehammer approach is a bit disturbing.
I have checked I am not setting up portc bits 0 and 1 as oscillator
in/out or using the T1 timer.
The slaves are monitoring 4 li-ion cells and are powered up all the
time. The I2C comms do not operate all the time.
Any ideas?
Regards
Jim Fell




More than likely your program has an unintentional worm written into
it. I bet you will find a pulse train on one or both LEDs. The timing
of the pulses may give you a clue as to the location of the worm.

Chad

--- seicento9999 <> wrote:
> Hello All
> On the 16f873 I am using, portc bits 0 and 1 are used for diagnostic
> leds. Each pin has a dropper resistor and led to ground. The port is
> set up as an outputs apart from bits 3 and 4 which are used for I2C
> comms.
> One led is set up to flash every time the program executes a full
> scan and the second led flashes each I2C communication. There are 18
> slave 16F873's and one master 16F877.
> Communication to all slaves is done every second. The slaves handle
> the I2C comms under interupt control.
> The problem is that after a few days one led goes off and stays off
> the other led is faintly lit.
> The code executes fine and the comms works fine it's just these leds
> go off/dim.
> Pressing the reset restores the led function.
> I have tried re writing to TRISC every scan this has no effect.
> A full system reset every few hours obviously works but this
> sledgehammer approach is a bit disturbing.
> I have checked I am not setting up portc bits 0 and 1 as oscillator
> in/out or using the T1 timer.
> The slaves are monitoring 4 li-ion cells and are powered up all the
> time. The I2C comms do not operate all the time.
> Any ideas?
> Regards
> Jim Fell >
>


=====
My software has no bugs. Only undocumented features.

__________________________________