English
Language : 

C8051F52X_12 Datasheet, PDF (71/221 Pages) Silicon Laboratories – 8/4/2 kB ISP Flash MCU Family
C8051F52x/F53x
4.5.1. Window Detector In Single-Ended Mode
Figure 4.7 shows two example window comparisons for right-justified data with
ADC0LTH:ADC0LTL = 0x0200 (512d) and ADC0GTH:ADC0GTL = 0x0100 (256d). The input voltage can
range from 0 to VREF x (4095/4096) with respect to GND, and is represented by a 12-bit unsigned integer
value. The repeat count is set to one. In the left example, an AD0WINT interrupt will be generated if the
ADC0 conversion word (ADC0H:ADC0L) is within the range defined by ADC0GTH:ADC0GTL and
ADC0LTH:ADC0LTL (if 0x0100 < ADC0H:ADC0L < 0x0200). In the right example, and AD0WINT interrupt
will be generated if the ADC0 conversion word is outside of the range defined by the ADC0GT and
ADC0LT registers (if ADC0H:ADC0L < 0x0100 or ADC0H:ADC0L > 0x0200). Figure 4.8 shows an exam-
ple using left-justified data with the same comparison values.
ADC0H:ADC0L
Input Voltage
(Px.x - GND)
VREF x (4095/4096) 0x0FFF
VREF x (512/4096)
VREF x (256/4096)
0x0201
0x0200
0x01FF
0x0101
0x0100
0x00FF
0
0x0000
AD0WINT
not affected
Input Voltage
(Px.x - GND)
VREF x (4095/
4096)
ADC0H:ADC0L
0x0FFF
ADC0LTH:ADC0LTL
AD0WINT=1
ADC0GTH:ADC0GTL
VREF x (512/4096)
VREF x (256/4096)
0x0201
0x0200
0x01FF
0x0101
0x0100
0x00FF
AD0WINT
not affected
0
0x0000
AD0WINT=1
ADC0GTH:ADC0GTL
AD0WINT
not affected
ADC0LTH:ADC0LTL
AD0WINT=1
Figure 4.7. ADC Window Compare Example: Right-Justified Single-Ended Data
ADC0H:ADC0L
Input Voltage
(Px.x - GND)
VREF x (4095/4096) 0xFFF0
VREF x (512/4096)
VREF x (256/4096)
0x2010
0x2000
0x1FF0
0x1010
0x1000
0x0FF0
ADC0H:ADC0L
Input Voltage
(Px.x - GND)
VREF x (4095/4096) 0xFFF0
AD0WINT
not affected
ADC0LTH:ADC0LTL
AD0WINT=1
ADC0GTH:ADC0GTL
VREF x (512/4096)
VREF x (256/4096)
0x2010
0x2000
0x1FF0
0x1010
0x1000
0x0FF0
AD0WINT=1
ADC0GTH:ADC0GTL
AD0WINT
not affected
ADC0LTH:ADC0LTL
0
0x0000
AD0WINT
not affected
0
0x0000
AD0WINT=1
Figure 4.8. ADC Window Compare Example: Left-Justified Single-Ended Data
Rev. 1.4
71