PIC18F2220 MICROCHIP [Microchip Technology], PIC18F2220 Datasheet - Page 223

no-image

PIC18F2220

Manufacturer Part Number
PIC18F2220
Description
28/40/44-Pin High-Performance, Enhanced Flash Microcontrollers with 10-Bit A/D and nanoWatt Technology
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18F2220-E/SO
Manufacturer:
MIC
Quantity:
20 000
Part Number:
PIC18F2220-I/SO
Manufacturer:
MICROCH
Quantity:
20 000
Part Number:
PIC18F2220-I/SP
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC18F2220T-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
20.0
The comparator module contains two analog compara-
tors. The inputs and outputs for the comparators are
multiplexed with the RA0 through RA5 pins. The on-
chip voltage reference (Section 21.0 “Comparator
Voltage Reference Module”) can also be an input to
the comparators.
The CMCON register, shown as Register 20-1,
controls the comparator module’s input and output
multiplexers.
comparator configurations is shown in Figure 20-1.
REGISTER 20-1:
 2003 Microchip Technology Inc.
COMPARATOR MODULE
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2-0
A
block
CMCON REGISTER
C2OUT: Comparator 2 Output bit
When C2INV = 0:
1 = C2 V
0 = C2 V
When C2INV = 1:
1 = C2 V
0 = C2 V
C1OUT: Comparator 1 Output bit
When C1INV = 0:
1 = C1 V
0 = C1 V
When C1INV = 1:
1 = C1 V
0 = C1 V
C2INV: Comparator 2 Output Inversion bit
1 = C2 output inverted
0 = C2 output not inverted
C1INV: Comparator 1 Output Inversion bit
1 = C1 output inverted
0 = C1 output not inverted
CIS: Comparator Input Switch bit
When CM2:CM0 = 110:
1 = C1 V
0 = C1 V
CM2:CM0: Comparator Mode bits
Figure 20-1 shows the Comparator modes and CM2:CM0 bit settings.
Legend:
R = Readable bit
- n = Value at POR
bit 7
C2OUT
diagram
R-0
C2 V
C2 V
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
+ > C2 V
+ < C2 V
+ < C2 V
+ > C2 V
+ > C1 V
+ < C1 V
+ < C1 V
+ > C1 V
- connects to RA3/AN3
- connects to RA2/AN2
- connects to RA0/AN0
- connects to RA1/AN1
C1OUT
of
R-0
the
IN
IN
IN
IN
IN
IN
IN
IN
-
-
-
-
-
-
-
-
PIC18F2220/2320/4220/4320
various
C2INV
R/W-0
W = Writable bit
‘1’ = Bit is set
C1INV
R/W-0
20.1
There are eight modes of operation for the comparators.
The CM bits (CMCON<2:0>) are used to select these
modes. Figure 20-1 shows the eight possible modes.
The TRISA register controls the data direction of the
comparator pins for each mode. If the Comparator mode
is changed, the comparator output level may not be valid
for the specified mode change delay shown in the
Electrical Specifications (see Section 26.0 “Electrical
Characteristics”).
Note:
Comparator Configuration
R/W-0
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
CIS
Comparator interrupts should be disabled
during a Comparator mode change.
Otherwise, a false interrupt may occur.
R/W-1
CM2
x = Bit is unknown
R/W-1
CM1
DS39599C-page 221
R/W-1
CM0
bit 0

Related parts for PIC18F2220