Chapter 23 Analog-to-Digital Converter (ADC)
MPC5602P Microcontroller Reference Manual, Rev. 4
588
Freescale Semiconductor
23.3.5
Programmable analog watchdog
23.3.5.1
Introduction
The analog watchdogs are used for determining whether the result of a channel conversion lies within a
given guarded area (as shown in
) specified by an upper and a lower threshold value named
THRH and THRL respectively.
Figure 23-6. Guarded area
After the conversion of the selected channel, a comparison is performed between the converted value and
the threshold values. If the converted value lies outside that guarded area then corresponding threshold
violation interrupts are generated. The comparison result is stored as WTISR[WDGxH] and
WTISR[WDGxL] as explained in
. Depending on the mask bits WTIMR[MSKWDGxL] and
WTIMR[MSKWDGxH], an interrupt is generated on threshold violation.
The TRC[THRCH] field specifies the channel on which the analog watchdog is applied. The analog
watchdog is enabled by setting the corresponding TRC[THREN].
The lower and higher threshold values for the analog watchdog are programmed using the THRHLR
registers.
For example, if channel number 3 is to be monitored with threshold values in THRHLR1, then the
TRC[THRCH] field is programmed to select channel number 3.
A set of threshold registers (THRHLRx and TRCx) can be linked only to a single channel for a particular
THRCH value. If another channel is to be monitored with same threshold values, then the TRCx[THRCH]
must be programmed again.
Table 23-4. Values of WDGxH and WDGxL fields
WDGxH
WDGxL
Converted data
1
0
converted data > THRH
0
1
converted data < THRL
0
0
THRL <= converted data <= THRH
THRH
THRL
Analog voltage
Upper threshold
Lower threshold
Guarded area