R01UH0092EJ0110 Rev.1.10
Page 629 of 807
Jul 31, 2012
M16C/64C Group
27. A/D Converter
27.3.3
A/D Conversion Result
When reading the ADi register before A/D conversion is completed, the undefined value is read. Read
the ADi register after completing A/D conversion. Use the following procedure to detect the completion
of A/D conversion.
•
In one-shot mode and single sweep mode:
The IR bit in the ADIC register becomes 1 (interrupt requested) at a completion of A/D conversion.
Ensure that the IR bit becomes 1 to read the ADi register.
When not using an A/D interrupt, set the IR bit to 0 (interrupt not requested) by a program after
reading the ADi register.
•
In repeat mode, repeat sweep mode 0, and repeat sweep mode 1:
The IR bit remains unchanged (no interrupt request is generated). At first, read the ADi register
after one A/D conversion time elapses (refer to 27.3.1 “A/D Conversion Cycle”). After that,
whenever the ADi register is read, the conversion result which has been obtained before reading is
read.
The ADi register is overwritten after every A/D conversion. Read the value before the ADi register
is overwritten.
27.3.4
Extended Analog Input Pins
In one-shot mode and repeat modes, pins ANEX0 and ANEX1 can be used as analog input pins by
setting bits ADEX1 to ADEX0 in the ADCON1 register.
The A/D conversion result of pins ANEX0 and ANEX1 are stored in registers AD0 and AD1,
respectively.
27.3.5
Current Consumption Reduce Function
When the A/D converter is not in use, power consumption can be reduced by setting the ADSTBY bit in
the ADCON1 register to 0 (A/D operation stopped: standby) to shut off any analog circuit current flow.
To use the A/D converter, set the ADSTBY bit to 1 (A/D operation enabled) and wait for one
φ
AD cycle
or more before setting the ADST bit in the ADCON0 register to 1 (A/D conversion start). Do not set bits
ADST and ADSTBY to 1 at the same time.
Also, do not set the ADSTBY bit to 0 (A/D operation stopped: standby) during A/D conversion.
27.3.6
Open-Circuit Detection Assist Function
The A/D converter has a function to set the charge of the sampling capacitor to a predefined state
(AVCC or AVSS) before A/D conversion starts. This helps prevent the influence of analog input voltage
from the previous conversion and more reliably detect an open-circuit of a trace connected to an analog
input pin.
Figure 27.6 shows A/D Open-Circuit Detection Example on AVCC (Preconversion Charge) and Figure
27.8 shows A/D Open-Circuit Detection Example on AVSS (Preconversion discharge).
The conversion result in open-circuit depends on the external circuit. Use this function only after careful
evaluation of the system.
Содержание M16C Series
Страница 846: ...M16C 64C Group R01UH0092EJ0110...