Rev.3.04
May 20, 2008
REJ03B0158-0304
38D5 Group
A/D CONVERTER
The 38D5 Group has a 10-bit A/D converter. The A/D converter
performs successive approximation conversion. The 38D5 Group
has the ADKEY function which perform A/D conversion of the
“L” level analog input from the ADKEY pin automatically.
[AD Conversion Register (ADL, ADH)]
One of these registers is a high-order register, and the other is a
low-order register. The high-order 8 bits of a conversion result is
stored in the AD conversion register (high-order) (address
001716), and the low-order 2 bits of the same result are stored in
bit 7 and bit 6 of the AD conversion register (low-order) (address
001616).
During A/D conversion, do not read these registers.
Also, the connection between the resistor ladder and reference
voltage input pin (VREF) can be controlled by the VREF input
switch bit (bit 0 of address 001616). When “1” is written to this
bit, the resistor ladder is always connected to VREF. When “0” is
written to this bit, the resistor ladder is disconnected from VREF
except during the A/D conversion.
[AD Control Register (ADCON)]
This register controls A/D converter. Bits 2 to 0 are analog input
pin selection bits. Bit 3 is an AD conversion completion bit and
“0” during A/D conversion. This bit is set to “1” upon
completion of A/D conversion.
A/D conversion is started by setting “0” in this bit.
Bit 5 is the ADKEY enable bit. The ADKEY function is enabled
by setting “1” to this bit. When this function is valid, the analog
input pin selection bits are ignored. Also, when bit 5 is “1”, do
not set “0” to bit 3 by program.
[Comparison Voltage Generator]
The comparison voltage generator divides the voltage between
AVSS and VREF, and outputs the divided voltages.
[Channel Selector]
The channel selector selects one of the input ports P57/AN7
P50/AN0 and inputs it to the comparator.
[Comparator and Control Circuit]
The comparator and control circuit compare an analog input
voltage with the comparison voltage and store the result in the
AD conversion register. When an A/D conversion is completed,
the control circuit sets the AD conversion completion bit and the
AD conversion interrupt request bit to “1”.
The comparator is constructed linked to a capacitor. The
conversion accuracy may be low because the change is lost if the
conversion speed is not enough.
Accordingly, set f(XIN) to at least 500 kHz during A/D
conversion in the XIN mode.
Also, do not execute the STP and WIT instructions during the
A/D conversion.
In the low-speed mode and on-chip oscillator mode, there is no
limit on the oscillation frequency because the on-chip oscillator
is used as the A/D conversion clock. In the low-speed mode, on-
chip oscillator starts oscillation automatically at the A/D
conversion is executed and stops oscillation automatically at the
A/D conversion is finished even though it is not oscillating.
Fig. 41 Block diagram of A/D converter
(Address 001716)
(Address 001616)
ADKEY
control circuit
AVSS
b7
b0
AD conversion register (L)
Data bus
C
h
a
n
e
lse
le
cto
r
AD conversion register (H)
Resistor ladder
Comparator
A/D interrupt request
AD control register
P50/AN0
P51/AN1
P52/AN2
P53/AN3
P54/AN4
P55/AN5
P56/AN6
P57/AN7/ADKEY0
VREF
1/ 8
1/ 2
φSOURCE
Note 1:
φSOURCE indicates the followings:
XIN input in the frequency/2, 4, or 8 mode
On-chip oscillator divided by 4 in the low-speed and the on-chip oscillator mode
A/D control circuit
(1)