Sean Breheny wrote: > > >So if your program drives bit 3 high but the corresponding pin is > >tied to ground the read operation gets a '0' for that bit. > >When the PIC writes back the modified value to the > >port the bit 3 is written as '0'. > > I don't see why one wouldn't just check their hardware for shorts > and other mistakes, instead of using this register > shadowing technique in a final design. > > Sean I think he meant the pin being pulled low either by say a link or a logic gate, and the pin being used as an input. i.e. it is tristated. This does not involve shorts. Register shadowing is needed, because what you read from mixed In/Out ports is partly incoming data, and thus not the byte you last wrote to the outgoing data buffer. This can cause screw ups when you re-enable an input pin as an output pin (for example, as part of a bidirectional data path).