WM8321
Production Data
18.4 DIGITAL COMPARATORS
The WM8321 has four digital comparators which may be used to compare AUXADC measurement
data against programmable threshold values. Each comparator has a status bit, and also an
associated interrupt flag (described in Section 18.5), which indicates that the associated data is
beyond the threshold value.
The digital comparators are enabled using the DCMPn_ENA register bits as described in Table 45.
After an AUXADC conversion, the measured value is compared with the threshold level of any
associated comparator(s). Note that this comparison is only performed following a conversion.
The source data for each comparator is selected using the DCMPn_SRC register bits; this selects
one of the AUXADC channels for each comparator. If required, the same AUXADC channel may be
selected for more than one comparator; this would allow more than one threshold to be monitored on
the same AUXADC channel. Note that the Backup Battery voltage input can only be monitored using
DCMP4.
The DCMPn_GT register bits select whether the status bit and associated interrupt flag will be
asserted when the measured value is above the threshold or when the measured value is below the
threshold. The output of the most recent threshold comparison is indicated in the DCOMPn_STS
fields.
The threshold DCMPn_THR is a 12-bit code for each comparator. This field follows the same voltage
or temperature coding as the associated AUXADC channel source (see Section 18.3).
ADDRESS
BIT
LABEL
DEFAULT
DESCRIPTION
R16432 (4030h)
DCOMP4_STS
Digital Comparator 4 status
11
0
Comparator
Control
0 = Comparator 4 threshold not
detected
1 = Comparator 4 threshold detected
(Trigger is controlled by DCMP4_GT)
Digital Comparator 3 status
DCOMP3_STS
DCOMP2_STS
DCOMP1_STS
10
0
0
0
0 = Comparator 3 threshold not
detected
1 = Comparator 3 threshold detected
(Trigger is controlled by DCMP3_GT)
Digital Comparator 2 status
9
0 = Comparator 2 threshold not
detected
1 = Comparator 2 threshold detected
(Trigger is controlled by DCMP2_GT)
Digital Comparator 1 status
8
0 = Comparator 1 threshold not
detected
1 = Comparator 1 threshold detected
(Trigger is controlled by DCMP1_GT)
Digital Comparator 4 Enable
0 = Disabled
DCMP4_ENA
DCMP3_ENA
DCMP2_ENA
DCMP1_ENA
3
0
0
1 = Enabled
Digital Comparator 3 Enable
0 = Disabled
2
1
1 = Enabled
Digital Comparator 2 Enable
0 = Disabled
0
1 = Enabled
Digital Comparator 1 Enable
0 = Disabled
0
0
1 = Enabled
R16433 (4031h)
DCMP1_SRC
[2:0]
Digital Comparator 1 source select
15:13
000
PD, February 2012, Rev 4.0
100
w