c8051t617 Silicon Laboratories, c8051t617 Datasheet - Page 55

no-image

c8051t617

Manufacturer Part Number
c8051t617
Description
Mixed Signal Byte-programmable Eprom Mcu
Manufacturer
Silicon Laboratories
Datasheet
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, with left-justi-
fied data format. The ADC output codes represent input voltages (AIN – GND) from 0 V to V
1024) and are represented as 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 ADC0H:L < 0x1000 or ADC0H:L > 0x2000).
REF x (1023/1204)
(AIN+ - GND)
Input Voltage
REF x (1/16)
REF x (1/8)
0
Programmable Window Detector
Figure 5.6. ADC Window Compare Example (Left-Justified Data)
if
ADC0
ADC0H:L
0xFFC0
0x1FC0
0x0FC0
0x2040
0x2000
0x1040
0x1000
0x0000
is
outside
ADC0GTH:L
ADC0LTH:L
not affected
not affected
AD0WINT
AD0WINT
of
the
AD0WINT=1
range
Rev. 0.3
REF x (1023/1024)
C8051T610/1/2/3/4/5/6/7
(AIN+ - GND)
Input Voltage
defined
REF x (1/16)
REF x (1/8)
0
by
ADC0H:L
0xFFC0
0x1FC0
0x0FC0
0x2040
0x2000
0x1040
0x1000
0x0000
ADC0GTH:L
and
ADC0GTH:L
not affected
ADC0LTH:L
AD0WINT
REF
ADC0LTH:L
AD0WINT=1
AD0WINT=1
x (1023/
55

Related parts for c8051t617