c8051t602 Silicon Laboratories, c8051t602 Datasheet - Page 42

no-image

c8051t602

Manufacturer Part Number
c8051t602
Description
Mixed Signal Otp Eprom Mcu Family
Manufacturer
Silicon Laboratories
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
c8051t602-GS
Manufacturer:
Silicon Labs
Quantity:
135
C8051T600/1/2/3/4/5
5.7.
The ADC Programmable Window Detector continuously compares the ADC0 output to user-programmed
limits, and notifies the system when a desired condition is detected. This is especially effective in an inter-
rupt-driven system, saving code space and CPU bandwidth while delivering faster system response times.
The window detector interrupt flag (AD0WINT in register ADC0CN) can also be used in polled mode. The
ADC0 Greater-Than (ADC0GTH, ADC0GTL) and Less-Than (ADC0LTH, ADC0LTL) registers hold the
comparison values. Example comparisons are shown in Figure 5.6. Notice that the window detector flag
can be programmed to indicate when measured data is inside or outside of the user-programmed limits
depending on the contents of the ADC0LTH:L and ADC0GTH:L registers.
5.7.1. Window Detector Example
Figure 5.6 shows two example window comparisons, using the ADC in 10-bit 1x gain mode. The ADC out-
put codes represent input voltages (AIN – GND) from 0 V to V
10-bit unsigned integers. Note that the hexadecimal numbers shown are left-justified, 10-bit values. In the
example on the left-hand side, an AD0WINT interrupt will be generated if the ADC0 conversion word
(ADC0H:L) is within the range defined by ADC0GTH:L and ADC0LTH:L (if 0x1000 < ADC0H:L < 0x2000).
In the example on the right-hand side, an AD0WINT interrupt will be generated if ADC0 is outside of the
range defined by ADC0GTH:L and ADC0LTH:L (if ADC0H:L < 0x1000 or ADC0H:L > 0x2000).
42
REF x (1023/1204)
Input Voltage
(AIN+ - GND)
REF x (1/16)
REF x (1/8)
0
Programmable Window Detector
ADC0H:L
0xFFC0
0x1FC0
0x0FC0
0x2040
0x2000
0x1040
0x1000
0x0000
Figure 5.6. ADC Window Compare Examples
ADC0GTH:L
ADC0LTH:L
not affected
not affected
AD0WINT
AD0WINT
AD0WINT=1
Rev. 0.5
REF x (1023/1024)
(AIN+ - GND)
Input Voltage
REF x (1/16)
REF x (1/8)
0
REF
x (1023/1024) and are represented as
ADC0H:L
0xFFC0
0x1FC0
0x0FC0
0x2040
0x2000
0x1040
0x1000
0x0000
ADC0GTH:L
ADC0LTH:L
not affected
AD0WINT
AD0WINT=1
AD0WINT=1

Related parts for c8051t602