Datasheet
PIC18F1230/1330
2009 Microchip Technology Inc. DS39758D-page 179
17.0 COMPARATOR MODULE
The analog comparator module contains three
comparators. The inputs can be selected from the
analog inputs multiplexed with pins RA0, RB2 and
RB3, as well as the on-chip voltage reference (see
Section 18.0 “Comparator Voltage Reference
Module”). The digital outputs are not available at the
pin level and can only be read through the control
register, CMCON (Register 17-1). CMCON also selects
the comparator input.
REGISTER 17-1: CMCON: COMPARATOR CONTROL REGISTER
R-0 R-0 R-0 U-0 U-0 R/W-0 R/W-0 R/W-0
C2OUT C1OUT C0OUT
— — CMEN2 CMEN1 CMEN0
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7 C2OUT: Comparator 2 Output bit
1 = C2 V
IN+ > C2 VIN- (CVREF)
0 = C2 V
IN+ < C2 VIN- (CVREF)
bit 6 C1OUT: Comparator 1 Output bit
1 = C1 VIN+ > C1 VIN- (CVREF)
0 = C1 V
IN+ < C1 VIN- (CVREF)-
bit 5 C0OUT: Comparator 0 Output bit
1 = C0 VIN+ > C0 VIN- (CVREF)
0 = C0 V
IN+ < C0 VIN- (CVREF)
bit 4-3 Unimplemented: Read as ‘0’
bit 2 CMEN2: Comparator 2 Enable bit
1 = Comparator 2 is enabled
0 = Comparator 2 is disabled
bit 1 CMEN1: Comparator 1 Enable bit
1 = Comparator 1 is enabled
0 = Comparator 1 is disabled
bit 0 CMEN0: Comparator 0 Enable bit
1 = Comparator 0 is enabled
0 = Comparator 0 is disabled