English
Language : 

LM3S9B81_15 Datasheet, PDF (1104/1271 Pages) Texas Instruments – Stellaris LM3S9B81 Microcontroller
Analog Comparators
1. Enable the analog comparator clock by writing a value of 0x0010.0000 to the RCGC1 register
in the System Control module (see page 271).
2. Enable the clock to the appropriate GPIO modules via the RCGC2 register (see page 280). To
find out which GPIO ports to enable, refer to Table 22-5 on page 1142.
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 22-4 on page 1135.
4. Configure the PMCn fields in the GPIOPCTL register to assign the analog comparator output
signals to the appropriate pins (see page 433 and Table 22-5 on page 1142).
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.
20.5
Register Map
Table 20-4 on page 1104 lists the comparator registers. The offset listed is a hexadecimal increment
to the register’s address, relative to the Analog Comparator base address of 0x4003.C000. Note
that the analog comparator clock must be enabled before the registers can be programmed (see
page 271). There must be a delay of 3 system clocks after the analog comparator module clock is
enabled before any analog comparator module registers are accessed.
Table 20-4. Analog Comparators Register Map
Offset Name
Type
Reset
Description
0x000
0x004
0x008
0x010
0x020
0x024
0x040
0x044
0x060
0x064
ACMIS
ACRIS
ACINTEN
ACREFCTL
ACSTAT0
ACCTL0
ACSTAT1
ACCTL1
ACSTAT2
ACCTL2
R/W1C
RO
R/W
R/W
RO
R/W
RO
R/W
RO
R/W
0x0000.0000
0x0000.0000
0x0000.0000
0x0000.0000
0x0000.0000
0x0000.0000
0x0000.0000
0x0000.0000
0x0000.0000
0x0000.0000
Analog Comparator Masked Interrupt Status
Analog Comparator Raw Interrupt Status
Analog Comparator Interrupt Enable
Analog Comparator Reference Voltage Control
Analog Comparator Status 0
Analog Comparator Control 0
Analog Comparator Status 1
Analog Comparator Control 1
Analog Comparator Status 2
Analog Comparator Control 2
See
page
1106
1107
1108
1109
1110
1111
1110
1111
1110
1111
1104
Texas Instruments-Production Data
July 03, 2014