Olin Lathrop wrote : > > If your external circuit holds the PIC pin in the opposite > state the PIC is driving it for more than a few cycles, > then there is likely something else wrong anyway. Hi. I think the actual case here was to set the PORT reg to some values (using BCF/BSF) *before* the port pins was switched to outputs by setting the TRIS bits. In that case the BCF/BSF could read just about anything from pins depending on how they was connected. The solution here is, as have been said, to use a shadow reg (that could be set by BCF/BSF commands if that simplifies the program logic), and then transfer the whole shadow reg using one MOVWF operation when all bits are ready. And, if I remember right, the issue was to not have a race condition on power on so there would not be any glitch on the output pin(s). That is, setting the PORT reg before switching the pin(s) to an output using the TRIS reg. Of course, you could BSF/BCF one PORT reg bit at a time and modify the same pin at a time in the TRIS, *if* the external curcuit is such as no pin could be hard driven to the "wrong" level... Jan-Erik. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu