COMP_E Operation
917
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
Comparator E (COMP_E) Module
35.2 COMP_E Operation
The COMP_E module is configured by user software. The setup and operation of COMP_E is discussed
in the following sections.
35.2.1 Comparator
The comparator compares the analog voltages at the positive (+) and negative (–) input terminals. If the +
terminal is more positive than the – terminal, the comparator output CEOUT is high. The comparator can
be switched on or off using control bit CEON. The comparator should be switched off when not in use to
reduce current consumption. When the comparator is off, CEOUT is low when CEOUTPOL bit is set to 0,
and CEOUT is high when CEOUTPOL bit is set to 1.
To optimize current consumption for the application, the lowest power mode that meets the comparator
speed requirements (see the device-specific data sheet for the comparator propagation delay and
response time) should be selected with the CEPWRMD bits. The CEPWRMD bits default to 0x0, which is
the highest power and fastest speed. CEPWRMD = 0x2 is the lowest power and slowest speed option.
35.2.2 Analog Input Switches
The analog input switches connect or disconnect the two comparator input terminals to associated port
pins using the CEIPSELx and CEIMSELx bits. The comparator terminal inputs can be controlled
individually. The CEIPSELx and CEIMSELx bits allow:
•
Application of an external signal to the V+ and V– terminals of the comparator
•
Application of an external current source (for example, a resistor) to the V+ or V– terminal of the
comparator
•
Mapping of both terminals of the internal multiplexer to the outside
Internally, the input switch is constructed as a T-switch to suppress distortion in the signal path.
NOTE:
Comparator Input Connection
When the comparator is on, the input terminals must be connected to a signal, power, or
ground. Otherwise, floating levels may cause unexpected interrupts and increased current
consumption.
The CEEX bit controls the input multiplexer, permuting the input signals of the comparator's V+ and V–
terminals. Additionally, when the comparator terminals are permuted, the output signal from the
comparator is also inverted. This allows the user to determine or compensate for the comparator input
offset voltage.
35.2.3 Port Logic
The Px.y pins that are associated with a comparator channel are enabled by the CEIPSELx or CEIMSELx
bits to disable the digital components while the terminals are used as comparator inputs. Only one of the
comparator input pins is selected as input to the comparator by the input multiplexer at a time.
35.2.4 Input Short Switch
The CESHORT bit shorts the Comparator_E inputs. This can be used to build a simple sample-and-hold
for the comparator as shown in