Sunday, March 22, 2009
PORTB and TRISB
PORTB is an 8-bit wide and bidirectional port. The corresponding data direction register for PORTB is TRISB. Setting a TRISB bit = 1 will make the corresponding PORTB pin an input (i.e.,put the corresponding output driver in a Hi-Impedance mode). Clearing a TRISB bit = 0 will make the corresponding PORTB pin an output (i.e., put the contents of the output latch on the selected pin).