COMP_E Operation
889
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Comparator E Module (COMP_E)
23.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.
23.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.
23.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
•
Routing of an internal reference voltage to an associated output port pin
•
Application of an external current source (for example, resistor) to the V+ or V- terminal of the
comparator
•
The 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 should 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 V+ and V-
terminals. Additionally, when the comparator terminals are permuted, the output signal from the
comparator is inverted too. This allows the user to determine or compensate for the comparator input
offset voltage.
23.2.3 Port Logic
The Px.y pins associated with a comparator channel are enabled by the CEIPSELx or CEIMSELx bits to
disable its digital components while used as comparator input. Only one of the comparator input pins is
selected as input to the comparator by the input multiplexer at a time.
23.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 (see
).