Datasheet

1996-2013 Microchip Technology Inc. Preliminary DS40143E-page 27
PIC16C55X
5.3 PORTC and TRISC Registers
(1)
PORTC is a 8-bit wide latch. All pins have data direc-
tion bits (TRIS registers) which can configure these
pins as input or output.
A '1' in the TRISC register puts the corresponding out-
put driver in a Hi-impedance mode. A '0' in the TRISC
register puts the contents of the output latch on the
selected pin(s).
Reading the PORTC register reads the status of the
pins, whereas writing to it will write to the port latch. All
write operations are read-modify-write operations. So a
write to a port implies that the port pins are first read,
then this value is modified and written to the port data
latch
FIGURE 5-5: BLOCK DIAGRAM OF
PORT PINS RC<7:0>
TABLE 5-5: PORTC FUNCTIONS
TABLE 5-6: SUMMARY OF REGISTERS ASSOCIATED WITH PORTC AND TRISC
Data
Bus
Q
D
Q
CK
QD
Q
CK
QD
EN
P
N
WR
PORTC
WR
Data Latch
TRIS Latch
RD TRISC
RD PORTC
V
SS
VDD
I/O pin
VSS
VDD
TRISC
TTL
Input
Buffer
Name Bit # Buffer Type Function
RC0 Bit 0 TTL Bi-directional I/O port.
RC1 Bit 1 TTL Bi-directional I/O port.
RC2 Bit 2 TTL Bi-directional I/O port.
RC3 Bit 3 TTL Bi-directional I/O port.
RC4 Bit 4 TTL Bi-directional I/O port.
RC5 Bit 5 TTL Bi-directional I/O port.
RC6 Bit 6 TTL Bi-directional I/O port.
RC7 Bit 7 TTL Bi-directional I/O port.
Legend: ST = Schmitt Trigger, TTL = TTL input
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Value on
POR
Value on
All Other
RESETS
07h PORTC RC7 RC6 RC5 RC4 RC3 RC2 RC1 RC0 xxxx xxxx uuuu uuuu
87h TRISC TRISC7 TRISC6 TRISC5 TRISC4 TRISC3 TRISC2 TRISC1 TRISC0 1111 1111 1111 1111
Legend: x = unknown, u = unchanged
Note 1: PIC16C557 ONLY.