PIC12F635/PIC16F636/639
4.3 PORTC
PORTC is a general purpose I/O port consisting of 6
bidirectional pins. The pins can be configured for either
digital I/O or analog input to comparator. For specific
information about individual functions, refer to the
appropriate section in this data sheet.
Note:
The CMCON0 (19h) register must be ini-
tialized to configure an analog channel as
a digital input. Pins configured as analog
inputs will read ‘0’.
EXAMPLE 4-3: INITIALIZING PORTC
BCF
BCF
CLRF
MOVLW
MOVWF
BSF
BCF
MOVLW
MOVWF
STATUS,RP0
STATUS,RP1
PORTC
07h
CMCON0
STATUS,RP0
STATUS,RP1
0Ch
TRISC
BCF
STATUS,RP0
BCF
STATUS,RP1
;Bank 0
;
;Init PORTC
;Set RC<4,1:0> to
;digital I/O
;Bank 1
;Set RC<3:2> as inputs
;and set RC<5:4,1:0>
;as outputs
;Bank 0
;
4.3.1 RC0/C2IN+
The RC0 pin is configurable to function as one of the
following:
• a general purpose I/O
• an analog input to the comparator
4.3.2
RC1/C2IN-
The RC1 pin is configurable to function as one of the
following:
• a general purpose I/O
• an analog input to the comparator
FIGURE 4-7:
Data Bus
BLOCK DIAGRAM OF RC0
AND RC1
WR
PORTC
DQ
CK Q
WR
TRISC
DQ
CK Q
RD
TRISC
RD
PORTC
VDD
I/O pin
VSS
Analog Input
Mode
To Comparators
4.3.3 RC2
The RC2 pin is configurable to function as a general
purpose I/O.
4.3.4 RC3
The RC3 pin is configurable to function as a general
purpose I/O.
4.3.5 RC5
The RC5 pin is configurable to function as a general
purpose I/O.
FIGURE 4-8:
BLOCK DIAGRAM OF
RC2, RC3 AND RC5
Data Bus
WR
PORTC
DQ
CK Q
WR
TRISC
DQ
CK Q
RD
TRISC
RD
PORTC
VDD
I/O pin
VSS
© 2005 Microchip Technology Inc.
Preliminary
DS41232B-page 49