
Comparator_D Operation
17.2 Comparator_D Operation
The Comparator_D module is configured by user software. The setup and operation of Comparator_D is
discussed in the following sections.
17.2.1 Comparator
The comparator compares the analog voltages at the + and – input terminals. If the + terminal is more
positive than the – terminal, the comparator output CDOUT is high. The comparator can be switched on or
off using control bit CDON. The comparator should be switched off when not in use to reduce current
consumption. When the comparator is switched off, CDOUT is always low. The bias current of the
comparator is programmable.
17.2.2 Analog Input Switches
The analog input switches connect or disconnect the two comparator input terminals to associated port
pins using the CDIPSELx and CDIMSELx bits. The comparator terminal inputs can be controlled
individually. The CDIPSELx and CDIMSELx bits allow:
•
Application of an external signal to the + and – terminals of the comparator
•
Application of an external current source (for example, a resistor) to the + or – 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 CDEX bit controls the input multiplexer, permuting the input signals of the comparator's + and –
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.
17.2.3 Port Logic
The Px.y pins associated with a comparator channel are enabled by the CDIPSELx or CDIMSELx 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.
17.2.4 Input Short Switch
The CDSHORT bit shorts the Comparator_D inputs. This can be used to build a simple sample-and-hold
for the comparator as shown in
464
Comparator_D
SLAU272C – May 2011 – Revised November 2013
Copyright © 2011–2013, Texas Instruments Incorporated