C8051F303-GSR Silicon Labs, C8051F303-GSR Datasheet - Page 45

no-image

C8051F303-GSR

Manufacturer Part Number
C8051F303-GSR
Description
8-bit Microcontrollers - MCU 8KB 14Pin MCU
Manufacturer
Silicon Labs
Datasheet

Specifications of C8051F303-GSR

Rohs
yes
Core
8051
Processor Series
C8051
Data Bus Width
8 bit
5.4.
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 (ADC0GT) and Less-Than (ADC0LT) registers hold the comparison values. Example
comparisons for Single-ended and Differential modes are shown in Figure 5.6 and Figure 5.7, respectively.
Notice that the window detector flag can be programmed to indicate when measured data is inside or out-
side of the user-programmed limits depending on the contents of the ADC0LT and ADC0GT registers.
5.4.1. Window Detector In Single-Ended Mode
Figure 5.6 shows two example window comparisons for Single-ended mode, with ADC0LT = 0x20 and
ADC0GT = 0x10. Notice that in Single-ended mode, the codes vary from 0 to VREF x (255/256) and are
represented as 8-bit unsigned integers. In the left example, an AD0WINT interrupt will be generated if the
ADC0
(if 0x10  ADC0  0x20). In the right example, and AD0WINT interrupt will be generated if ADC0 is outside
of the range defined by ADC0GT and ADC0LT (if ADC0  0x10 or ADC0  0x20).
REF x (255/256)
REF x (32/256)
REF x (16/256)
Input Voltage
(P0.x - GND)
Programmable Window Detector
conversion
0
Figure 5.6. ADC Window Compare Examples, Single-Ended Mode
ADC0
0xFF
0x21
0x20
0x1F
0x11
0x10
0x0F
0x00
word
(ADC0)
not affected
not affected
AD0WINT
AD0WINT
ADC0GT
ADC0LT
is
AD0WINT=1
within
Rev. 2.9
the
REF x (255/256)
REF x (32/256)
REF x (16/256)
Input Voltage
(P0.x - GND)
range
0
C8051F300/1/2/3/4/5
defined
ADC0
0xFF
0x21
0x20
0x1F
0x11
0x10
0x0F
0x00
by
ADC0GT
not affected
AD0WINT
ADC0GT
ADC0LT
and
AD0WINT=1
AD0WINT=1
ADC0LT
45

Related parts for C8051F303-GSR