![](http://datasheet.mmic.net.cn/280000/GMS82524T_datasheet_16059967/GMS82524T_52.png)
GMS81508B/16B/24B, GMS82512/16/24
MAY. 2001 Ver 2.0
49
12. ANALOG DIGITAL CONVERTER
The analog-to-digital converter (A/D) allows conversion
of an analog input signal to a corresponding 8-bit digital
value. The A/D module has eight analog inputs, which are
multiplexed into one sample and hold. The output of the
sample and hold is the input into the converter, which gen-
erates the result via successive approximation. The analog
supply voltage is connected to AV
DD
of ladder resistance
of A/D module.
The A/D module has two registers which are the control
register ADCM and A/D result register ADR. The register
ADCM, shown in Figure 12-2, controls the operation of
the A/D converter module. The port pins can be configured
as analog inputs or digital I/O. To use analog inputs, I/O is
selected input mode by R6DD direction register.
R60 ~ R63 are NOT served on GMS825xx.
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 ADR contains the results of the A/D
conversion. When the conversion is completed, the result
is loaded into the ADR, the A/D conversion status bit
ADSF is set to “1”, and the A/D interrupt flag AIF is set.
The block diagram of the A/D module is shown in Figure
12-1. 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 maximum 20
uS (at f
XIN
=8 MHz).
Figure 12-1 A/D Block Diagram
Note:
On the MDS(Choice-Dr,Jr), when the MCU is RE-
SET, R60 port is selected as an analog input by ADCM reg-
ister. So it can not be used digital input port. To use this port
as a digital I/O port, change to except “0” the value of AD-
CM. Finally all eight ports can not be used as digital I/O port
simultaneously on the MDS. At least one port must be in an-
alog port.
But on the OTP and Main chip, R6 port, all eight pins can
be used as digital I/O port at the same time.
*
R60/AN0
*
R61/AN1
*
R62/AN2
*
R63/AN3
R64/AN4
R65/AN5
R66/AN6
R67/AN7
S/H
Sample & Hold
“0”
“1”
ADEN
AV
DD
8
L
ADIF
A/D
INTERRUPT
SUCCESSIVE
APPROXIMATION
CIRCUIT
ADR
A/D result register
ADDRESS: E9
RESET VALUE: Undefined
000
001
010
011
100
101
110
111
ADS[2:0]
*
These ports are NOT served on the GMS825xx.