English
Language : 

LM3S5P36 Datasheet, PDF (860/1050 Pages) Texas Instruments – Stellaris® LM3S5P36 Microcontroller
Analog Comparators
Figure 18-2. Structure of Comparator Unit
- ve input
+ ve input 0
1
+ ve input (alternate)
2
reference input
CINV
ACCTL
output
IntGen
TrigGen
ACSTAT
18.3.1
A comparator is configured through two status/control registers, Analog Comparator Control
(ACCTL) and Analog Comparator Status (ACSTAT). The internal reference is configured through
one control register, Analog Comparator Reference Voltage Control (ACREFCTL). Interrupt
status and control are configured through three registers, Analog Comparator Masked Interrupt
Status (ACMIS), Analog Comparator Raw Interrupt Status (ACRIS), and Analog Comparator
Interrupt Enable (ACINTEN).
Typically, the comparator output is used internally to generate an interrupt as controlled by the ISEN
bit in the ACCTL register. The output may also be used to drive an external pin, Co or generate an
analog-to-digital converter (ADC) trigger.
Important: The ASRCP bits in the ACCTL register must be set before using the analog comparators.
Internal Reference Programming
The structure of the internal reference is shown in Figure 18-3 on page 860. The internal reference
is controlled by a single configuration register (ACREFCTL).
Figure 18-3. Comparator Internal Reference Structure
VDDA
8R
R
8R
R
R
•••
EN
VREF
RNG
15 14
•••
1
0
Decoder
internal
reference
VIREF
The internal reference can be programmed in one of two modes (low range or high range) depending
on the RNG bit in the ACREFCTL register. When RNG is clear, the internal reference is in high-range
mode, and when RNG is set the internal reference is in low-range mode.
In each range, the internal reference, VIREF, has 16 pre-programmed thresholds or step values. The
threshold to be used to compare the external input voltage against is selected using the VREF field
in the ACREFCTL register.
860
January 21, 2012
Texas Instruments-Production Data