The TRIS opcode causes W to be loaded into the respective port IO control register, which is different from the port IO proper (PORTA or PORTB). The written value cannot be read back. You need to keep track of it in your program otherwise. Peter -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads