Download Print this page

Renesas M16C/50 Series User Manual page 665

Advertisement

M16C/5L Group, M16C/56 Group
24.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:
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 24.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.
24.3.4
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.
24.3.5
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 24.6 shows A/D Open-Circuit Detection Example on AVCC (Preconversion Charge) and Figure
24.7 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.
R01UH0127EJ0110 Rev.1.10
Sep 01, 2011
24. A/D Converter
Page 628 of 803

Advertisement

loading