>I was assuming that a read only operation would not affect the data in the >port latch- although it doesnt say that specifically- but the last bit >"care >should be taken ... changing the direction from an input to an output" just >confuses things further- or do they mean doing a RMW operation and then >changing TRIS, in which case the caution doesnt really apply? I guess I missed the original question. But I can give an example of how this can cause problems: Pretend you're using passive I2C communication where the SCL and SDA lines are being pulled up. You load "0" into the latches for your SDA and SCL pins. Now you want to set the SCL line high, so you TRIS the pin to an INPUT. Now it's being pulled HIGH, even though your latch is still a "0". Now you want to set the SCL line low, so you TRIS the pin back to an OUTPUT. Everything's fine. Now, pretend you have an interrupt set and it goes off BETWEEN the two steps described above (i.e., you're still in an INPUT mode). Now somewhere in the ISR, you happen to use a "BCF" on another pin of the same port. This will redefine your SCL latch to a "1" because of the RMW operation on the other pin. So, you have to "use caution when changing from an input to an output" because of the possible unknown state of the port latches. Note that it's not a "READ" operation, per se, but a "BCF". A pure READ operation will do nothing to the port pin values itself, but it WILL redefine the port latches. Note that this is just one example of how things can go bad. But I think you can draw a parallel to your specific situation, assuming that your application has any problems at all with these operations. --Andrew _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads