PIC12F639 Microchip Technology, PIC12F639 Datasheet - Page 51

no-image

PIC12F639

Manufacturer Part Number
PIC12F639
Description
(PIC12F635 / PIC12F636 / PIC12F639) 8/14-PIN FLASH-BASED / 8-BIT CMOS MICROCONTROLLERS WITH NANOWATT TECHNOLOGY
Manufacturer
Microchip Technology
Datasheet
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 comparator. For specific
information about individual functions, refer to the
appropriate section in this data sheet.
EXAMPLE 4-3:
4.3.1
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
The RC1 pin is configurable to function as one of the
following:
• a general purpose I/O
• an analog input to the comparator
© 2005 Microchip Technology Inc.
BCF
BCF
CLRF
MOVLW
MOVWF
BSF
BCF
MOVLW
MOVWF
BCF
BCF
Note:
PORTC
STATUS,RP0
STATUS,RP1
PORTC
07h
CMCON0
STATUS,RP0
STATUS,RP1
0Ch
TRISC
STATUS,RP0
STATUS,RP1
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’.
RC0/C2IN+
RC1/C2IN-
INITIALIZING PORTC
;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
;
PIC12F635/PIC16F636/639
Preliminary
FIGURE 4-7:
4.3.3
The RC2 pin is configurable to function as a general
purpose I/O.
4.3.4
The RC3 pin is configurable to function as a general
purpose I/O.
4.3.5
The RC5 pin is configurable to function as a general
purpose I/O.
FIGURE 4-8:
PORTC
PORTC
TRISC
TRISC
Data Bus
PORTC
PORTC
WR
WR
Data Bus
TRISC
TRISC
RD
RD
WR
WR
RD
RD
D
D
RC2
RC3
RC5
CK
CK
D
D
To Comparators
CK
CK
Q
Q
Q
Q
Q
Q
Q
Q
BLOCK DIAGRAM OF RC0
AND RC1
BLOCK DIAGRAM OF
RC2, RC3 AND RC5
Analog Input
Mode
DS41232B-page 49
V
V
DD
SS
V
V
DD
SS
I/O pin
I/O pin

Related parts for PIC12F639