PIC16F684-I/SLG Microchip, PIC16F684-I/SLG Datasheet - Page 42

no-image

PIC16F684-I/SLG

Manufacturer Part Number
PIC16F684-I/SLG
Description
pic, flash, Microcontrollers, Microprocessors, Semiconductors and Actives, ic, mcu
Manufacturer
Microchip
Datasheet
PIC16F684
4.3
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 Enhanced CCP or the A/D, refer to the
appropriate section in this data sheet.
EXAMPLE 4-3:
4.3.1
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
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
DS41202C-page 40
BCF
CLRF
MOVLW
MOVWF
BSF
CLRF
MOVLW
MOVWF
BCF
Note:
PORTC
STATUS,RP0
PORTC
07h
CMCON0
STATUS,RP0
ANSEL
0Ch
TRISC
STATUS,RP0
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’.
RC0/AN4/C2IN+
RC1/AN5/C2IN-
INITIALIZING PORTC
;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
Preliminary
FIGURE 4-7:
PORTC
PORTC
TRISC
TRISC
Data Bus
WR
WR
RD
RD
Note 1:
D
D
To Comparators
To A/D Converter
CK
CK
Analog Input mode comes from ANSEL or
Comparator mode.
Q
Q
Q
Q
BLOCK DIAGRAM OF RC0
AND RC1
 2004 Microchip Technology Inc.
Analog Input
Mode
(1)
V
V
DD
SS
I/O PIN

Related parts for PIC16F684-I/SLG