English
Language : 

PIC16F636T-I Datasheet, PDF (76/234 Pages) Microchip Technology – 8/14-Pin, Flash-Based 8-Bit CMOS Microcontrollers with nanoWatt Technology
PIC12F635/PIC16F636/639
7.3 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 Figures 7-6 and 7-7.
I/O lines change as a function of the mode and are
designed 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 7-6:
COMPARATOR I/O OPERATING MODES (PIC12F635)
Comparator Reset (POR Default Value – low power)
CM<2:0> = 000
Comparator w/o Output and with Internal Reference
CM<2:0> = 100
CIN- A
CIN+ A
COUT (pin) I/O
Comparator with Output
CM<2:0> = 001
Off(1)
CIN- A
CIN+ I/O
COUT
COUT (pin) I/O
From CVREF Module
Multiplexed Input with Internal Reference and Output
CM<2:0> = 101
CIN- A
CIN+ A
COUT (pin) D
Comparator without Output
CM<2:0> = 010
COUT
CIN- A
CIN+ A
CIS = 0
CIS = 1
COUT
COUT (pin) D
From CVREF Module
Multiplexed Input with Internal Reference
CM<2:0> = 110
CIN- A
CIN+ A
COUT (pin) I/O
COUT
Comparator with Output and Internal Reference
CM<2:0> = 011
A
CIN-
A
CIN+
COUT (pin) I/O
CIS = 0
CIS = 1
COUT
From CVREF Module
Comparator Off (Lowest power)
CM<2:0> = 111
CIN- A
CIN+ I/O
COUT (pin) D
COUT
From CVREF Module
Legend: A = Analog Input, ports always reads ‘0’
I/O = Normal port I/O
Note 1: Reads as ‘0’, unless CINV = 1.
CIN- I/O
CIN+ I/O
COUT (pin) I/O
Off(1)
CIS = Comparator Input Switch (CMCON0<3>)
D = Comparator Digital Output
DS41232D-page 74
© 2007 Microchip Technology Inc.