If there's any confusion on how to set the pin direction, I like to think of it this way... the TRIS register is short for TRI-STATE register.
If a pin is tri-state, it's floating, so it must be an input. Setting the TRIS bit = 1 enables the tri-state, so 1=input, 0=output.
Bookmarks