V
CC
V
SS
I
CC
V
O
V
I
0
V
CC
V
I
V
CC
I
CC
CEPDx = 1
COMP_E Operation
892
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Comparator E Module (COMP_E)
The voltage reference generator is used to generate VREF, which can be applied to either comparator
input terminal. The CEREF1x (VREF1) and CEREF0x (VREF0) bits control the output of the voltage
generator. The CERSEL bit selects the comparator terminal to which VREF is applied. If external signals
are applied to both comparator input terminals, the internal reference generator should be turned off to
reduce current consumption. The voltage reference generator can generate a fraction of the device's V
CC
or of the voltage reference of the integrated precision voltage reference source. Vref1 is used while
CEOUT is 1, and Vref0 is used while CEOUT is 0. This allows the generation of a hysteresis without using
external components.
23.2.7 Port Disable Register (CEPD)
The comparator input and output functions are multiplexed with the associated I/O port pins, which are
digital CMOS gates. When analog signals are applied to digital CMOS gates, parasitic current can flow
from V
CC
to GND. This parasitic current occurs if the input voltage is near the transition level of the gate.
Disabling the port pin buffer eliminates the parasitic current flow and therefore reduces overall current
consumption.
The CEPDx bits, when set, disable the corresponding Px.y input buffer as shown in
. When
current consumption is critical, any Px.y pin connected to analog signals should be disabled with their
associated CEPDx bits.
Selecting an input pin to the comparator multiplexer with the CEIPSEL or CEIMSEL bits automatically
disables the input buffer for that pin, regardless of the state of the associated CEPDx bit.
Figure 23-5. Transfer Characteristic and Power Dissipation in a CMOS Inverter/Buffer
23.2.8 Comparator_E Interrupts
One interrupt flag and one interrupt vector are associated with the Comparator_E.
The interrupt flag CEIFG is set on either the rising or falling edge of the comparator output, selected by
the CEIES bit. The comparator gives out an interrupt signal when both CEIFG and CEIE bits are set. The
comparator interrupt can be serviced by the CPU when the comparator interrupt is enabled appropriately
at the NVIC.
NOTE:
Changing the value of CEIES bit might set the comparator interrupt flag CEIFG. This can
happen even when the comparator is disabled (CEON = 0). It is recommended to clear
CEIFG after configuring the comparator for proper interrupt behavior during operation.
23.2.9 Comparator_E Used to Measure Resistive Elements
The Comparator_E can be optimized to precisely measure resistive elements using single slope analog-
to-digital conversion. For example, temperature can be converted into digital data using a thermistor, by
comparing the thermistor's capacitor discharge time to that of a reference resistor (see
). A
reference resistor Rref is compared to Rmeas.