![Dallas DS87C550 Скачать руководство пользователя страница 86](http://html1.mh-extra.com/html/dallas/ds87c550/ds87c550_user-manual-supplement_3298646086.webp)
DS87C550 High-Speed Microcontroller User’s Guide Supplement
86 of 93
(1/11.0592MHz * 2) *(5 + 1) = 1.085
µ
s
A/D REFERENCE VOLTAGE
A precision reference voltage is required by the A/D conversion process. Since this reference voltage is
used in all conversions, it must be precise and stable. Otherwise the A/D result will be similarly unstable
or imprecise (see the A/D result equation below). This reference may be obtained either from an internal
band-gap or from a user supplied external source as selected by the ADRS (PWMADR.7) bit.
A/D Result = 1024(Vin – AV
REF
-
) / (AV
REF
+
- AV
REF
-
)
When the ADRS bit is cleared (reset default condition), the internal band-gap is selected as the A/D’s
positive reference voltage, and analog ground is the negative reference. This internal band-gap produces a
positive A/D reference voltage of 2.5 volts typically (see DC specifications) and therefore limits the range
of analog voltages on the input pins to the range of 0 to 2.5 volts. If a larger analog input voltage is
desirable, an external reference voltage may be used.
When the ADRS bit is set, the user may provide an external voltage reference to the A/D on pins AV
REF
+
and AV
REF
-.
These voltages have minimum and maximum specifications associated with them which must
be followed (see DS specifications). However, AV
REF
+
may be in the range of the analog supply voltage
AV
CC
which is most frequently 5 volts. Therefore a larger range of analog input voltages (0 to 5 volts) is
possible when an external voltage reference is used.
A/D INTERRUPT
The interrupt flag for the A/D converter is the EOC bit (ADCON1.6) and is set by hardware when the
current conversion completes. Once set it must be cleared by software. This interrupt is qualified by
several settings. First for an A/D interrupt to be acknowledged, the EAD (Enable A/D Interrupt, IE.6) bit
must be set. Additionally as with all interrupts, the global interrupt enable bit, EA (IE.7) must be set
before any interrupt will be acknowledged. The A/D interrupt is also qualified by the WCM bit
(ADCON1.2) when the user selects the window comparison function by setting the WCQ (ADCON1.3)
bit. With WCQ set, an A/D interrupt will occur only when the comparison function is true. If WCQ is not
set, then an A/D interrupt will occur any time when EOC is set and enable bits EAD and EA are set. A
more detailed description of the window comparison function follows.
WINDOWED COMPARATOR
The A/D Converter found in some Dallas High-Speed Microcontrollers has a unique feature associated
with it called the Window Comparator. This feature allows the user to establish boundaries against which
each A/D converter result is compared. If the results of the A/D are “of interest” as defined by the user
supplied boundary conditions, the feature will allow an interrupt to be generated. Otherwise no interrupt
is generated, and the results can be ignored. This relieves the processor of the burden of acknowledging
data that is not of interest.
The user enables this feature by setting the Window Comparator Qualifier bit WCQ (ADCON1.3). Of
course as described in the discussion of interrupts, the A/D interrupt enable and global interrupt enable
bits must also be set for an interrupt to be acknowledged. The user sets the boundaries with the two 8-bit
registers WINHI and WINLO. The values loaded into these registers are compared to each A/D result. It
is important to note that the comparison is performed between one of these registers and the eight MSBs
of the A/D result. This comparison takes place before the 10-bit A/D result is passed to the two 8-bit
result registers ADMSB and ADLSB. Therefore the user selected method of displaying the 10-bit result
has no affect on the comparison function. The comparison is always performed on the eight MSBs of the