Table 22-4. Analog Comparator Voltage Reference Characteristics, V
DDA
= 3.3V, EN= 1, and
RNG = 1
Unit
V
IREF
Max
Ideal V
IREF
V
IREF
Min
VREF
Value
V
0.074
0.000
0.000
0x0
V
0.223
0.149
0.076
0x1
V
0.372
0.298
0.225
0x2
V
0.521
0.448
0.374
0x3
V
0.670
0.597
0.523
0x4
V
0.820
0.746
0.672
0x5
V
0.969
0.895
0.822
0x6
V
1.118
1.044
0.971
0x7
V
1.267
1.193
1.120
0x8
V
1.416
1.343
1.269
0x9
V
1.565
1.492
1.418
0xA
V
1.715
1.641
1.567
0xB
V
1.864
1.790
1.717
0xC
V
2.013
1.939
1.866
0xD
V
2.162
2.089
2.015
0xE
V
2.311
2.238
2.164
0xF
22.4
Initialization and Configuration
The following example shows how to configure an analog comparator to read back its output value
from an internal register.
1.
Enable the analog comparator clock by writing a value of 0x0000.0001 to the
RCGCACMP
register in the System Control module (see page 397).
2.
Enable the clock to the appropriate GPIO modules via the
RCGCGPIO
register (see page 382).
To find out which GPIO ports to enable, refer to Table 26-5 on page 1808.
3.
In the GPIO module, enable the GPIO port/pin associated with the input signals as GPIO inputs.
To determine which GPIO to configure, see Table 26-4 on page 1797.
4.
Configure the
PMCn
fields in the
GPIOPCTL
register to assign the analog comparator output
signals to the appropriate pins (see page 787 and Table 26-5 on page 1808).
5.
Configure the internal voltage reference to 1.65 V by writing the
ACREFCTL
register with the
value 0x0000.030C.
6.
Configure the comparator to use the internal voltage reference and to
not
invert the output by
writing the
ACCTLn
register with the value of 0x0000.040C.
7.
Delay for 10 µs.
8.
Read the comparator output value by reading the
ACSTATn
register's
OVAL
value.
Change the level of the comparator negative input signal
C-
to see the
OVAL
value change.
June 18, 2014
1658
Texas Instruments-Production Data
Analog Comparators