English
Language : 

PIC16F688 Datasheet, PDF (42/174 Pages) Microchip Technology – 14-Pin Flash-Based, 8-Bit CMOS Microcontrollers with nanoWatt Technology
PIC16F688
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 A/D converter or compara-
tor. For specific information about individual functions
such as the EUSART or the A/D, refer to the appropriate
section in this data sheet.
Note:
The ANSEL (91h) and CMCON0 (19h)
registers must be initialized to configure
an analog channel as a digital input. Pins
configured as analog inputs will read ‘0’.
EXAMPLE 4-3: INITIALIZING PORTC
BCF
CLRF
MOVLW
MOVWF
BSF
CLRF
MOVLW
MOVWF
STATUS,RP0
PORTC
07h
CMCON0
STATUS,RP0
ANSEL
0Ch
TRISC
BCF
STATUS,RP0
;Bank 0
;Init PORTC
;Set RC<4,1:0> to
;digital I/O
;Bank 1
;digital I/O
;Set RC<3:2> as inputs
;and set RC<5:4,1:0>
;as outputs
;Bank 0
4.3.1 RC0/AN4/C2IN+
The RC0 is configurable to function as one of the
following:
• a general purpose I/O
• an analog input for the A/D Converter
• an analog input to the comparator
4.3.2
RC1/AN5/C2IN-
The RC1 is configurable to function as one of the
following:
• a general purpose I/O
• an analog input for the A/D Converter
• an analog input to the comparator
FIGURE 4-7:
Data Bus
BLOCK DIAGRAM OF RC0
AND RC1
DQ
WR
PORTC
CK Q
WR
TRISC
DQ
CK Q
RD
TRISC
Analog Input
Mode(1)
RD
PORTC
To Comparators
To A/D Converter
VDD
I/O Pin
VSS
Note 1: Analog Input mode is based upon Comparator mode
and ANSEL.
DS41203B-page 40
Preliminary
 2004 Microchip Technology Inc.