Datasheet

1996 Microchip Technology Inc.
Preliminary
DS40122B-page 27
PIC14000
This interrupt can wake the device up from SLEEP. The
user, in the interrupt service routine, can clear the
interrupt in one of two ways:
Disable the interrupt by clearing the RCIE
(PIE1<2>) bit
Read PORTC. This will end mismatch condition.
Then, clear the RCIF (PIR1<2>) bit.
A mismatch condition will continue to set the RCIF bit.
Reading PORTC will end the mismatch condition, and
allow the RCIF bit to be cleared.
If bit CMAOE (CMCON<1>) is set, the RC0/REFA pin
becomes the programmable reference A and analog
output. Pin RC1/CMPA becomes the comparator A out-
put.
PORTC<7:6> also serves multiple functions. These
pins act as the I
2
C data and clock lines when the I
2
C
module is enabled. They also serve as the serial pro-
gramming interface data and clock line for in-circuit
programming of the EPROM.
Note:
Setting CMAOE changes the definition of
RC0/REFA and RC1/CMPA, bypassing
the PORTC data and TRISC register set-
tings.
The TRISC register controls the direction of the
PORTC pin. A ‘1’ in each location configures the
corresponding port pin as an input. Upon reset, this
register sets to FFh, meaning all PORTC pins are ini-
tially inputs. The data register should be initialized prior
to configuring the port as outputs.
Unused inputs should not be left floating to avoid
leakage currents. All pins have input protection diodes
to V
DD
and V
SS
.
EXAMPLE 5-2: INITIALIZING PORTC
CLRF PORTC ; Initialize PORTC data
; latches before setting
; the data direction
; register
BSF STATUS, RPO ; Select Bank1
MOVLW 0xCF ; Value used to initialize
; data direction
MOVWF TRISC ; Set RC<3:0> as inputs
; RC<5:4> as outputs
;
RC<7:6> as inputs
FIGURE 5-3: BLOCK DIAGRAM OF PORTC<7:6> PINS
D
Q
CK
Q
D
Q
CK
Q
D
Q
EN
Data
Bus
Write
PORTC
Write
TRISC
Read
TRISC
N
I/O
Pin
V
DD
Schmitt Trigger
Input
Buffer
D
Q
EN
Read
PORTC
Read PORTC
From other
PORTC pins
Set
RCIF
Note: I/O pins have protection diodes to VDD and VSS. These pins do not have a P-channel pull-up.
I
2
CCON<5>
N
V
SS