Dr Skip wrote: > Microchip seems to agree. From their support: Do they ? > > ------------- > Read-modify-write can cause that. I strongly recommend never bit setting or > clearing a port. You should always read the port,... I thought we agreed on that it is the *reading* of the port that is the potential source of RMW problems... Jan-Erik. copy it to ram, modify the > bit, then write that back out to the whole port. Since the PIC is trying to > change all 8 bits (even if some are the same), this prevents it from reading > the other bits and changing them. You can learn more about read-modify-write > by searching our knowledge base. > > The PIC18 gets around this by having an output "LAT"ch register. If you bit > set LATB,3 for example, then only that pins output register is set, the others > are not read from the outside world or modified. > > Finally, watch out for capacitive loading on pins. If a pin is strongly > capacitive, it could be read incorrectly due to the capacitance holding the pin > state. When read incorrectly, it is also written in correctly. Again, using > the method mentioned above should assist with this issue as well. > -------------- > > > Wouter van Ooijen wrote: >> I definitely do advocate using shadow registers. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist