English
Language : 

MC80F0204 Datasheet, PDF (68/126 Pages) List of Unclassifed Manufacturers – 8-BIT SINGLE-CHIP MICROCONTROLLERS
MC80F0104/0204
Preliminary
14. ANALOG TO DIGITAL CONVERTER
The analog-to-digital converter (A/D) allows conversion
of an analog input signal to a corresponding 10-bit digital
value. The A/D module has ten (eight for MC80F0104) an-
alog inputs, which are multiplexed into one sample and
hold. The output of the sample and hold is the input into the
converter, which generates the result via successive ap-
proximation.
The analog reference voltage is selected to VDD or AVref
by setting of the bit AVREFS in PSR1 register. If external
analog reference AVref is selected, the analog input chan-
nel 0 (AN0) should not be selected to use. Because this pin
is used to an analog reference of A/D converter.
The A/D module has three registers which are the control
register ADCM and A/D result register ADCRH and AD-
CRL. The ADCRH[7:6] is used as ADC clock source se-
lection bits too. The register ADCM, shown in Figure 14-
4 , controls the operation of the A/D converter module. The
port pins can be configured as analog inputs or digital I/O.
It is selected for the corresponding channel to be converted
by setting ADS[3:0]. The A/D port is set to analog input
port by ADEN and ADS[3:0] regardless of port I/O direc-
tion register. The port unselected by ADS[3:0] operates as
normal port.
Enable A/D Converter
A/D Input Channel Select
Conversion Source Clock Select
A/D Start (ADST = 1)
How to Use A/D Converter
The processing of conversion is start when the start bit
ADST is set to “1”. After one cycle, it is cleared by hard-
ware. The register ADCRH and ADCRL contains the re-
sults of the A/D conversion. When the conversion is
completed, the result is loaded into the ADCRH and AD-
CRL, the A/D conversion status bit ADSF is set to “1”, and
the A/D interrupt flag ADCIF is set. See Figure 14-1 for
operation flow.
The block diagram of the A/D module is shown in Figure
14-3 . The A/D status bit ADSF is set automatically when
A/D conversion is completed, cleared when A/D conver-
sion is in process. The conversion time takes 13 times of
conversion source clock. The conversion source clock
should selected for the conversion time being more than
25µs.
A/D Converter Cautions
(1) Input range of AN0 ~ AN7, AN14 and AN15
The input voltage of A/D input pins should be within the
specification range. In particular, if a voltage above VDD
(or AVref) or below VSS is input (even if within the abso-
lute maximum rating range), the conversion value for that
channel can not be indeterminate. The conversion values
of the other channels may also be affected.
(2) Noise countermeasures
In order to maintain 10-bit resolution, attention must be
paid to noise on pins VDD (or AVref) and analog input pins
(AN0 ~ AN7, AN14, AN15). Since the effect increases in
proportion to the output impedance of the analog input
source, it is recommended in some cases that a capacitor be
connected externally as shown in Figure 14-2 in order to
reduce noise. The capacitance is user-selectable and appro-
priately determined according to the target system.
NOP
ADSF = 1
NO
YES
Read ADCR
Figure 14-1 A/D Converter Operation Flow
Analog
Input
0~1000pF
User Selectable
AN0~AN7
AN14, AN15
Figure 14-2 Analog Input Pin Connecting Capacitor
64
Mar. 2005 Ver 0.2