"Alan B. Pearce" wrote: > The TRIS bit is getting changed somehow while another couple of pins ar= e > having their tris bits changed to change direction Let me guess, you used BSF or BCF on TRISC? There is a problem with read-modify-write instructions on the TRIS registers with certain peripherals active. TRISC<3:4> have to be inputs (1) for the SSP module = to work, however if you do an RMW operation to TRISC at a moment when the SS= P module is using one of those pins as an output, the bit will read as a 0,= and get written back as a 0. See section 3.3 of the 16F877 datasheet. Jason Harper -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.