
216
CHAPTER 11
A/D CONVERTER
User’s Manual U12790EJ2V0UD
(7) Interrupt request flag (ADIF)
The interrupt request flag (ADIF) is not cleared even if analog input channel specification register 3 (ADS3)
is changed.
Caution is therefore required since, if the analog input pin is changed during A/D conversion, the A/D
conversion result and conversion end interrupt request flag for the pre-change analog input may be set just
before the ADS3 rewrite, and when ADIF is read immediately after the ADM rewrite, ADIF may be set despite
the fact that the A/D conversion for the post-change analog input has not ended.
When A/D conversion is stopped and then resumed, clear the ADIF before it is resumed.
Figure 11-12. A/D Conversion End Interrupt Request Generation Timing
Remarks 1. n = 0, 1, ..., 7
2. m = 0, 1, ..., 7
(8) Conversion result immediately after starting A/D conversion
The first A/D conversion result value is undefined immediately after an A/D conversion operation has been
started. Poll the A/D conversion end interrupt request (INTAD) and discard the first conversion result.
(9) Reading A/D conversion result register 3 (ADCR3)
If data is written to A/D converter mode register 3 (ADM3) and analog input channel specification register 3
(ADS3), the contents of ADCR3 are undefined. Read the conversion value before writing ADM3 and ADS3
after the conversion operation has been completed. Otherwise, the correct conversion result may not be read.
A /D conversion
ADCR3
INTAD
ANIn
ANIm
ANIn
ANIm
ADM3 rewrite
(Start of ANIn conversion)
ADS3 rewrite
(Start of ANIm conversion)
ADIF is set but ANIm
conversion has not ended