English
Language : 

Z8F0113HJ005EG Datasheet, PDF (141/245 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore! XP® F0823 Series
Product Specification
126
Software Compensation Procedure
The value read from the ADC high and low byte registers are uncompensated. The user
mode software must apply gain and offset correction to this uncompensated value for
maximum accuracy. The following formula yields the compensated value:
ADCcomp = ADCuncomp – OFFCAL + ADCuncomp – OFFCALGAINCAL  21
where GAINCAL is the gain calibration byte, OFFCAL is the offset calibration byte and
ADCuncomp is the uncompensated value read from the ADC. The OFFCAL value is in
two’s complement format, as are the compensated and uncompensated ADC values.
Note: The offset compensation is performed first, followed by the gain compensation. One bit of
resolution is lost because of rounding on both the offset and gain computations. As a result
the ADC registers read back 13 bits: 1 sign bit, two calibration bits lost to rounding and 10
data bits. Also note that in the second term, the multiplication must be performed before
the division by 216. Otherwise, the second term evaluates to zero incorrectly.
Caution: Although the ADC can be used without the gain and offset compensation, it does exhibit
non-unity gain. Designing the ADC with sub-unity gain reduces noise across the ADC
range but requires the ADC results to be scaled by a factor of 8/7.
ADC Control Register Definitions
The following sections define the ADC Control registers.
ADC Control Register 0
The ADC Control Register selects the analog input channel and initiates the analog-to-dig-
ital conversion.
PS024315-1011
PRELIMINARY
ADC Control Register Definitions