GPIO is an 6-bit wide, bi-directional port.
The corresponding data direction register is TRISIO.
Setting a TRISIO bit (= 1) will make the corresponding GPIO pin an input (i.e., put the corresponding output driver in a
Hi-impedance mode).
Clearing a TRISIO bit (= 0) will make the corresponding GPIO pin an output (i.e., put the contents of the output latch on the selected pin).
The exception is GP3, which is input only and its TRISIO bit will always read as ‘1’.
Example 3-1 shows how to initialize GPIO.