Start of setup
End
Set the PER0 register
Set the ADTES register
Count the A/D voltage stabilization wait time
Set the ADCS bit
Start of discharging
Set the ADCS bit
Start of A/D conversion
End of A/D conversion
The conversion results are stored in
the ADCR and ADCRH registers
The ADCEN bit of the PER0 register is set (1), and a clock is supplied
to the A/D converter.
Set the ADCE bit
Count the stabilization wait time (0.125 μs) by software.
After counting of the stabilization wait time ends, the ADCS bit of the
ADM0 register is set (1) and discharging the sampling capacitor starts.
At the same time, the A/D conversion end interrupt request signal
(INTAD) is generated, and the ADCS bit of the ADM0 register is
automatically cleared (0) (conversion standby state).
End of A/D
conversion
Set the ADTES register
The ADCS bit of the ADM0 register is set (1) and A/D conversion starts.
A/D conversion ends and the conversion results are stored in the
ADCR and ADCRH registers.
At the same time, the A/D conversion end interrupt request signal
(INTAD) is generated, and the ADCS bit of the ADM0 register is
automatically cleared (0) (conversion standby state).
• Set the ADM0 register
• Set the ADM2 register
• Set the ADS register
(The order of setting is irrelevant.)
The conversion time and each mode of the A/D converter are set.
• A/D converter mode register 0 (ADM0)
The LV0 bit is set to 0. FR1 and FR0 bits: Select the A/D conversion time.
• A/D converter mode register 2 (ADM2)
ADTYP bit: Select 10-bit or 8-bit resolution.
• Analog input channel specification register (ADS)
Set the ADS3, ADS2, ADS1, and ADS0 bits = 1101B. Select the internal
reference voltage (0.815 V (typ.)) as the target of A/D conversion.
Select V
SS
as the target of A/D conversion to perform conversion with
discharge of the sampling capacitor.
• The ADTES1 bit of the ADTES register is set (1).
The operation of the A/D voltage comparator is started.
• The ADCE bit of the ADM0 register is set (1), and the system enters
the conversion standby state.
After discharging ends, the target of A/D conversion is changed to the
internal reference voltage (0.815 V (typ.)).
• The ADTES1 bit of the ADTES register is cleared (0).
First A/D
conversion
Second
and
subsequent
rounds
of A/D
conversion