269 / 342 page

LM3S310 Data Sheet
October 6, 2006
269
Preliminary
13.2
Functional Description
Important: It is recommended that the Digital-Input enable (the GPIODEN bit in the GPIO
module) for the analog input pin be disabled to prevent excessive current draw from
the I/O pads.
The comparator compares the VIN- and VIN+ inputs to produce an output, VOUT.
As shown in Figure 13-2, the input source for VIN- is an external input. In addition to an external
input, input sources for VIN+ can be the +ve input of comparator 0 or an internal reference.
Figure 13-2.
Structure of Comparator Unit
A comparator is configured through two status/control registers (ACCTL and ACSTAT). The
internal reference is configured through one control register (ACREFCTL). Interrupt status and
control is configured through three registers (ACMIS, ACRIS, and ACINTEN). The operating
modes of the comparators are shown in Table 13-1, Table 13-2 and Table 13-3.
Typically, the comparator output is used internally to generate controller interrupts. It may also be
used to drive an external pin.
Important: Certain register bit values must be set before using the analog comparators. The
proper pad configuration for the comparator input and output pins are described in
Table 8-1 on page 108.
Table 13-1.
Comparator 0 Operating Modes
ACCNTL0
Comparator 0
ASRCP
VIN-
VIN+
Output
Interrupt
00
C0-
C0+
C0o
yes
01
C0-
C0+
C0o
yes
10
C0-
Vref
C0o
yes
11
C0-
reserved
C0o
yes
output
-ve input
+ve input
+ve input (alternate)
reference input
ACSTAT
ACCTL
IntGen
2
1
0
CINV