Texas Instruments MSP430x1xx User Manual

Page 269

Advertising
background image

Comparator_A Description

14-3

Comparator_A

14.2 Comparator_A Description

The comparator_A peripheral module is comprised of several major blocks.
These blocks are described in this section.

14.2.1 Input Analog Switches

The input analog switches connect or disconnect the comparator input termi-
nals to associated port pins using the P2CA0 and P2CA1 control bits. Both ter-
minal inputs can be controlled individually. P2CA0 and P2CA1 allow:

-

Application of an external signal to the + and – terminals of the comparator,
or

-

Routing of an internal reference voltage (if applied) to a comparator-input
terminal as an output on an associated port pin. In this way, the internal
reference voltage can be used to bias external circuitry.

Internally, the input switch is constructed as a T-switch to suppress distortion
in the signal path. When a comparator terminal is not connected to an external
pin, it should be connected to an internal reference-voltage level.

Note:

Ensure that the comparator input terminals are connected to signal, power,
or ground level. Otherwise, floating levels may cause unexpected interrupts
and current consumption may increase.

14.2.2 Input Multiplexer

Control bit CAEX controls the input multiplexer to select which input signals are
connected to the comparator’s + and – terminals. Additionally, when the
comparator terminals are exchanged, the output signal from the comparator
is inverted. This allows the user to determine or compensate for the compara-
tor offset.

14.2.3 The Comparator

The comparator compares the analog voltages at the + and – input terminals.
If the + terminal is more positive than the – terminal, the comparator output will
be high (note that the value of signal CAOUT also depends on the value of
CAEX). The comparator can be switched on or off using control bit CAON. The
comparator should be switched off when not in use to stop its current con-
sumption. When the comparator is switched off, the output is low (note that the
value of CAOUT still depends on the value of CAEX, even when the compara-
tor is off).

14.2.4 The Output Filter

The output of the comparator can be used with or without internal filtering.
When control bit CAF is set, the output is filtered with an-chip RC-filter. The
filter is bypassed when CAF is reset.

Advertising