English
Language : 

PIC16F684_07 Datasheet, PDF (60/192 Pages) Microchip Technology – 14-Pin, Flash-Based 8-Bit CMOS Microcontrollers with nanoWatt Technology
PIC16F684
8.2 Comparator Configuration
There are eight modes of operation for the comparator.
The CM<2:0> bits of the CMCON0 register are used to
select these modes as shown in Figure 8-5. I/O lines
change as a function of the mode and are designated
as follows:
• Analog function (A): digital input buffer is disabled
• Digital function (D): comparator digital output,
overrides port function
• Normal port function (I/O): independent of
comparator
The port pins denoted as “A” will read as a ‘0’
regardless of the state of the I/O pin or the I/O control
TRIS bit. Pins used as analog inputs should also have
the corresponding TRIS bit set to ‘1’ to disable the
digital output driver. Pins denoted as “D” should have
the corresponding TRIS bit set to ‘0’ to enable the
digital output driver.
Note:
Comparator interrupts should be disabled
during a Comparator mode change to
prevent unintended interrupts.
FIGURE 8-5:
COMPARATOR I/O OPERATING MODES
Comparators Reset
CM<2:0> = 000
C1IN- A
C1IN+ A
(POR Default Value)
VIN-
VIN+ C1
Off(1)
Two Independent Comparators
CM<2:0> = 100
C1IN- A
VIN-
C1IN+ A
VIN+ C1
C1OUT
C2IN- A
C2IN+ A
VIN-
VIN+ C2
Off(1)
C2IN- A
C2IN+ A
VIN-
VIN+ C2
C2OUT
Three Inputs Multiplexed to Two Comparators
CM<2:0> = 001
C1IN- A
C1IN+ A
CIS = 0 VIN-
CIS = 1 VIN+ C1
C1OUT
One Independent Comparator
CM<2:0> = 101
C1IN- I/O
C1IN+ I/O
VIN-
VIN+ C1
Off(1)
C2IN- A
C2IN+ A
VIN-
VIN+ C2
C2OUT
Four Inputs Multiplexed to Two Comparators
CM<2:0> = 010
C1IN- A
C1IN+ A
CIS = 0
CIS = 1
VIN-
VIN+ C1
C1OUT
C2IN- A
C2IN+ A
CIS = 0
CIS = 1
VIN-
VIN+ C2
C2OUT
From CVREF Module
Two Common Reference Comparators
CM<2:0> = 011
C1IN- A
C1IN+ I/O
VIN-
VIN+ C1
C1OUT
C2IN- A
C2IN+ A
VIN-
VIN+ C2
C2OUT
Legend: A = Analog Input, ports always reads ‘0’
I/O = Normal port I/O
Note 1: Reads as ‘0’, unless CxINV = 1.
C2IN- A
C2IN+ A
VIN-
VIN+ C2
C2OUT
Two Common Reference Comparators with Outputs
CM<2:0> = 110
C1IN- A
VIN-
VIN+ C1
C1OUT
C1OUT(pin) D
C2IN- A
C2IN+ A
VIN-
VIN+ C2
C2OUT
C2OUT(pin) D
Comparators Off (Lowest Power)
CM<2:0> = 111
C1IN- I/O
C1IN+ I/O
VIN-
VIN+ C1
Off(1)
C2IN- I/O
C2IN+ I/O
VIN-
VIN+ C2
Off(1)
CIS = Comparator Input Switch (CMCON0<3>)
D = Comparator Digital Output
DS41202F-page 58
© 2007 Microchip Technology Inc.