
46
μ
PD17145(A1), 17147(A1), 17149(A1)
14.2 Function of A/D Converter
(1) ADC
0
to ADC
3
pins
These pins input analog voltages to the four channels of the A/D converter. The analog voltages are
converted into digital signals. The A/D converter is provided with a sample and hold circuit, and an analog
input voltage being converted into a digital signal is internally held.
(2) V
REF
pin
This pin inputs a reference voltage to the A/D converter.
The signals input to ADC
0
to ADC
3
are converted into digital signals based on the voltage applied across
V
REF
and GND. The A/D converter of the
μ
PD17149(A1) has a function to automatically stop the current
flowing into the V
REF
pin when the A/D converter does not operate. A current flows into the V
REF
pin in the
following cases:
1
In successive mode (ADCSOFT = 0)
Since the ADCSTRT flag has been set to 1 until the ADCEND flag is set to 1.
In single mode (ADCSOFT = 1)
Since the ADCSTRT flag has been set to 1 or a value has been written to the 8-bit data register until
the result of comparison by the comparator is written to the ADCCMP flag.
2
Remarks 1.
If the HALT instruction is executed during A/D conversion, the A/D converter operates,
in the successive mode, until the ADCEND flag is set, or in the single mode, until the
result of conversion is stored to the ADCCMP flag. Therefore, a current flows to the V
REF
pin during this period.
A/D conversion in progress is stopped if the STOP instruction is executed. In this case,
the A/D converter is initialized, and the current flowing to the V
REF
pin is cut (the A/D
converter does not operate even if the STOP mode has been released).
2.
(3) 8-bit data register (ADCR)
This is an 8-bit register that stores the result of A/D conversion of successive approximation type in the
successive mode. The contents of this register are read by using the GET instruction. In the single mode,
the contents of the 8-bit data register are converted into an analog voltage by an internal D/A converter and
is compared by the comparator with an analog signal input from the ADCn pin. A value can be written to
this register by using the PUT instruction.
(4) Comparator
The comparator compares the analog input voltage with the voltage output by the D/A converter. If the
analog input voltage is high, it outputs “1”; if the voltage is low, the comparator outputs “0”. The result of
comparison is stored to the 8-bit data register (ADCR) in the successive mode, and to the ADCCMP flag
in the single mode.