146
CHAPTER 10 A/D CONVERTER
User’s Manual U15104EJ2V0UD
(4) ANI0 to ANI5
The analog input pins ANI0 to ANI5 also function as input port (P10 to P15) pins.
When A/D conversion is performed with any of pins ANI0 to ANI5 selected, be sure not to execute a PORT1
input instruction while conversion is in progress, as this may reduce the conversion resolution.
Also, if digital pulses are applied to a pin adjacent to the pin in the process of A/D conversion, the expected
A/D conversion value may not be obtainable due to coupling noise. Therefore, avoid applying pulses to pins
adjacent to the pin undergoing A/D conversion.
(5) 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 an 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 the A/D conversion is stopped and then resumed, clear ADIF before it is resumed.
Figure 10-11. A/D Conversion End Interrupt Request Generation Timing
Remarks 1. n = 0, 1, ..., 5
2. m = 0, 1, ..., 5
(6) Conversion result immediately after starting A/D conversion
The first A/D conversion result value is undefined immediately after the A/D conversion operation has been
started. Poll the A/D conversion completion interrupt request (INTAD3) and discard the first conversion result.
(7) 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 can be 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
INTAD3
ANIn
ANIn
ANIm
ANIm
ANIn
ANIn
ANIm
ANIm
ADM3 rewrite
(Start of ANIn conversion)
ADS3 rewrite
(Start of ANIm conversion)
ADIF is set but ANIm
conversion has not ended