It definitely sounds like a read-modify-write problem. What happens is the HIGH & LOW commands create BSF PORT,PIN for HIGH, and BCF PORT,PIN for LOW.
This reads the value of the port, flips the bit in question, then writes the whole 8-bit value back to the port. The problem is after you set C0 then set C1. If C0 hasn't transitioned to logic 1 before it sets C1, then it reads-in a logic 0 on C0, then places a logic 0 on C0 when it sets C1.
With PORTC = xx it doesn't read the port first, flip a single bit, then write back, so you don't see this problem.
Normally R-M-W is caused by external capacitance on the pin, which doesn't allow time for the previous pin to transition to the expected logic state before changing the next port pin. But the long delays in between flipping each bit is usually sufficient time for the previous pin to make the transition to the expected logic state.
With 500mS or 1 second in between it should be more than enough time so I would have to suspect a problem in your circuit causing the previous pin you set being read back as 0 on the next BSF op.
This same problem is seen when you don't disable analog features on a port, but there aren't any A/D pins on portc. Pins configured as analog are always read in as zero when the port is read as digital inputs.
It might help if you could post your schematic.




Bookmarks