z8f0813 ZiLOG Semiconductor, z8f0813 Datasheet - Page 132

no-image

z8f0813

Manufacturer Part Number
z8f0813
Description
High-performance 8-bit Microcontrollers
Manufacturer
ZiLOG Semiconductor
Datasheet
Table 72. ADC Control Register 0 (ADCCTL0)
ADC Control Register Definitions
BITS
FIELD
RESET
R/W
ADDR
PS024314-0308
Note:
Caution:
ADC Control Register 0
CEN
R/W
ADC comp
7
0
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:
where GAINCAL is the gain calibration byte, OFFCAL is the offset calibration byte and
ADC
two’s complement format, as are the compensated and uncompensated ADC values.
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 2
The following sections define the ADC control registers.
The ADC Control register selects the analog input channel and initiates the
analog-to-digital conversion.
CEN—Conversion Enable
0 = Conversion is complete. Writing a 0 produces no effect. The ADC automatically clears
this bit to 0 when a conversion is complete.
1 = Begin conversion. Writing a 1 to this bit starts a conversion. If a conversion is already
in progress, the conversion restarts. This bit remains 1 until the conversion is complete.
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.
uncomp
REFSELL
R/W
=
6
0
is the uncompensated value read from the ADC. The OFFCAL value is in
(
ADC uncomp OFFCAL
REFEXT
R/W
16
5
0
. Otherwise, the second term evaluates to zero incorrectly.
CONT
R/W
4
0
F70H
)
+
(
(
ADC uncomp OFFCAL
R/W
3
0
Z8 Encore! XP
R/W
2
0
ANAIN[3:0]
Product Specification
Analog-to-Digital Converter
R/W
) ∗ GAINCAL
1
0
®
F0823 Series
R/W
) 2 16
0
0
122

Related parts for z8f0813