Analog To Digital Converter - Abov MC80F0304 User Manual

8-bit single-chip microcontrollers
Table of Contents

Advertisement

MC80F0304/08/16

14. ANALOG TO DIGITAL CONVERTER

analog input signal to a corresponding 10-bit digital value. The A/
The analog-to-digital converter (A/D) allows conversion of an
ADCRH and ADCRL contains the results of the A/D conversion.
set to "1". After one cycle, it is cleared by hardware. The register
D module has sixteen analog inputs, which are multiplexed into
When the conversion is completed, the result is loaded into the
one sample and hold. The output of the sample and hold is the in-
ADCRH and ADCRL, the A/D conversion status bit ADSF is set
approximation.
put into the converter, which generates the result via successive
for operation flow.
to "1", and the A/D interrupt flag ADCIF is set. See Figure 14-1
The analog reference voltage is selected to V
or AVref by set-
The block diagram of the A/D module is shown in Figure 14-3 .
ting of the bit AVREFS in PSR1 register. If external analog ref-
DD
The A/D status bit ADSF is set automatically when A/D conver-
erence AVref is selected, the analog input channel 0 (AN0)
sion is completed, cleared when A/D conversion is in process.
reference of A/D converter.
should not be selected to use. Because this pin is used to an analog
The conversion source clock should selected for the conversion
The conversion time takes 13 times of conversion source clock.
The A/D module has three registers which are the control register
time being more than 25μs.
ADCM and A/D result register ADCRH and ADCRL. The AD-
CRH[7:6] is used as ADC clock source selection bits too. The
A/D Converter Cautions
register ADCM, shown in Figure 14-4 , controls the operation of
the A/D converter module. The port pins can be configured as an-
(1) Input range of AN0 ~ AN15
alog inputs or digital I/O.
cation range. In particular, if a voltage above V
The input voltage of A/D input pins should be within the specifi-
(or AVref) or
It is selected for the corresponding channel to be converted by
below V
SS
is input (even if within the absolute maximum rating
DD
setting ADS[3:0]. The A/D port is set to analog input port by
range), the conversion value for that channel can not be indeter-
ADEN and ADS[3:0] regardless of port I/O direction register.
The port unselected by ADS[3:0] operates as normal port.
affected.
minate. The conversion values of the other channels may also be
(2) Noise countermeasures
In order to maintain 10-bit resolution, attention must be paid to
Enable A/D Converter
noise on pins V
DD
(or AVref) and analog input pins (AN0 ~
AN15). Since the effect increases in proportion to the output im-
cases that a capacitor be connected externally as shown in Figure
pedance of the analog input source, it is recommended in some
A/D Input Channel Select
14-2 in order to reduce noise. The capacitance is user-selectable
and appropriately determined according to the target system.
Conversion Source Clock Select
A/D Start (ADST = 1)
Input
Analog
AN0~AN15
0~1000pF
User Selectable
NOP
Figure 14-2 Analog Input Pin Connecting Capacitor
ADSF = 1
NO
YES
(3) I/O operation
Read ADCR
output port pins. When A/D conversion is performed with any
The analog input pins AN0 ~ AN15 also have function as input/
pin, be sure not to execute a PORT input instruction with the se-
Figure 14-1 A/D Converter Operation Flow
lected pin while conversion is in progress, as this may reduce the
How to Use A/D Converter
conversion resolution.
The processing of conversion is start when the start bit ADST is
Also, if digital pulses are applied to a pin adjacent to the pin in the
process of A/D conversion, the expected A/D conversion value
78
November 4, 2011 Ver 2.12

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents