
235
CHAPTER 13 A/D CONVERTER
User
’
s Manual U14260EJ3V1UD
13.4.3 A/D converter operation mode
Select one analog input channel from among ANI0 to ANI7 using analog input channel specification register 0
(ADS0) to start A/D conversion.
A/D conversion can be started in either of the following two ways.
Hardware start: Conversion is started by trigger input (rising edge, falling edge, or both rising and falling edges
enabled).
Software start: Conversion is started by setting A/D converter mode register 0 (ADM0).
When A/D conversion is complete, the interrupt request signal (INTAD0) is generated.
(1) A/D conversion by hardware start
When bit 6 (TRG0) and bit 7 (ADCS0) of A/D converter mode register 0 (ADM0) are set to 1 after bit 0 (ADCE0)
is set to 1, the A/D conversion standby state is set. When the external trigger signal (ADTRG) is input, A/D
conversion of the voltage applied to the analog input pin specified by analog input channel specification register
0 (ADS0) starts.
Upon the end of A/D conversion, the conversion result is stored in A/D conversion result register 0 (ADCR0),
and the interrupt request signal (INTAD0) is generated. After one A/D conversion operation is started and
finished, the A/D conversion operation is not started until a new external trigger signal is input.
If ADM0 and ADS0 are rewritten during A/D conversion, the converter suspends A/D conversion and waits for
a new external trigger signal to be input. When the external trigger input signal is reinput, A/D conversion is
restarted from the beginning. If ADS0 is rewritten during A/D conversion standby, A/D conversion restarts from
the beginning when the following external trigger input signal is input.
If 1 is written to ADCS0 again during A/D conversion, the A/D conversion in progress is discontinued and the
A/D conversion is restarted from the beginning when the next external trigger input signal is input.
If 0 is written to ADCS0 during A/D conversion, the A/D conversion operation stops immediately. At this time,
the conversion result is undefined.
Caution
When P03/INTP3/ADTRG is used as the external trigger input (ADTRG), specify the valid edge
using bits 1 and 2 (EGA00, EGA01) of A/D converter mode register 0 (ADM0) and set the
interrupt mask flag (PMK3) to 1.