Z8 Encore! XP
®
4K Series
Product Specification
115
can output values across the entire 11-bit range, from -1024 to +1023. In SINGLE-
ENDED mode, the output generally ranges from 0 to +1023, but offset errors can cause
small negative values.
The ADC registers actually return 13 bits of data, but the two LSBs are intended for com-
pensation use only. When the software compensation routine is performed on the 13 bit
raw ADC value, two bits of resolution are lost because of a rounding error. As a result, the
final value is an 11- bit number.
Automatic Powerdown
If the ADC is idle (no conversions in progress) for 160 consecutive system clock cycles,
portions of the ADC are automatically powered down. From this powerdown state, the
ADC requires 40 system clock cycles to power up. The ADC powers up when a conver-
sion is requested by the ADC Control register.
Single-Shot Conversion
When configured for single-shot conversion, the ADC performs a single analog-to-digital
conversion on the selected analog input channel. After completion of the conversion, the
ADC shuts down. The steps for setting up the ADC and initiating a single-shot conversion
are as follows:
1. Enable the desired analog inputs by configuring the general-purpose I/O pins for
alternate analog function. This configuration disables the digital input and output
drivers.
2. Write the
and
if the
alarm function is required.
3. Write the
to configure the ADC
–
Write to
BUFMODE[2:0]
to select SINGLE-ENDED or DIFFERENTIAL mode,
as well as unbuffered or buffered mode.
–
If the alarm function is required, set
ALMHEN
and/or
ALMLEN.
–
Write the
REFSELH
bit of the pair {
REFSELH
,
REFSELL
} to select the internal
voltage reference level or to disable the internal reference. The
REFSELL
bit is.
contained in the
4. Write to the
to configure the ADC and begin the conversion.
The bit fields in the ADC Control register can be written simultaneously (the ADC
can be configured and enabled with the same write instruction):
–
Write to the
ANAIN[3:0]
field to select from the available analog input sources
(different input pins available depending on the device)
–
Clear
CONT
to 0 to select a single-shot conversion.
PS022815-0206
Analog-to-Digital Converter