PIC16C432
7.0 COMPARATOR MODULE
The comparator module contains two analog
comparators. The inputs to the comparators are
multiplexed with the RA0 through RA3 pins. The on-
chip voltage reference (Section 8.0) can also be an
input to the comparators.
The CMCON register, shown in Register 7-1, controls
the comparator input and output multiplexers. A block
diagram of the comparator is shown in Figure 7-1.
REGISTER 7-1:
CMCON REGISTER (ADDRESS 1Fh)
R-0
R-0
U-0
U-0
C2OUT C1OUT
—
—
bit7
R/W-0
CIS
R/W-0
CM2
R/W-0
CM1
R/W-0
CM0
bit0
bit 7
bit 6
bit 5-4
bit 3
bit 2-0
C2OUT: Comparator 2 Output bit
1 = C2 VIN+ > C2 VIN-
0 = C2 VIN+ < C2 VIN-
C1OUT: Comparator 1 Output bit
1 = C1 VIN+ > C1 VIN-
0 = C1 VIN+ < C1 VIN-
Unimplemented: Read as '0'
CIS: Comparator Input Switch bit
When CM<2:0> = 001:
1 = C1 VIN- connects to RA3
0 = C1 VIN- connects to RA0
When CM<2:0> = 010:
1 = C1 VIN- connects to RA3
C2 VIN- connects to RA2
0 = C1 VIN- connects to RA0
C2 VIN- connects to LINRX
CM<2:0>: Comparator Mode bits
(See Figure 7-1)
Legend:
R = Readable bit
- n = Value at POR reset
W = Writable bit
’1’ = Bit is set
7.1 Comparator Configuration
There are eight modes of operation for the
comparators. The CMCON register is used to select
the mode. Figure 7-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 Table 12-1.
Note:
Comparator interrupts should be disabled
during a Comparator mode change, other-
wise a false interrupt may occur.
U = Unimplemented bit, read as ‘0’
’0’ = Bit is cleared x = Bit is unknown
2000-2013 Microchip Technology Inc.
Preliminary
DS41140C-page 33