
MC80F0104/0204
Preliminary
64
Mar. 2005 Ver 0.2
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 V
DD
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.
Figure 14-1 A/D Converter Operation Flow
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 V
DD
(or AVref) or below V
SS
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 V
DD
(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.
Figure 14-2 Analog Input Pin Connecting Capacitor
ADSF = 1
YES
NO
Enable A/D Converter
A/D Input Channel Select
Conversion Source Clock Select
A/D Start (ADST = 1)
NOP
Read ADCR
AN0~AN7
Analog
Input
0~1000pF
User Selectable
AN14, AN15
Содержание MC80C0104
Страница 108: ...MC80F0104 0204 Preliminary 104 Mar 2005 Ver 0 2 25 Emulator EVA Board Setting...
Страница 115: ...APPENDIX...
Страница 116: ......
Страница 124: ...viii Mar 2005 Ver 0 2 MC80F0104 0204 Preliminary...