
CHAPTER 13 A/D CONVERTER
User’s Manual U17790EJ2V0UD
479
13.5.3 Trigger mode
The timing of starting the conversion operation is specified by setting a trigger mode. The trigger mode includes a
software trigger mode and hardware trigger modes. The hardware trigger modes include timer trigger modes 0 and 1,
and external trigger mode. The ADA0M0.ADA0TMD bit is used to set the trigger mode. The hardware trigger modes
are set by the ADA0M2.ADA0TMD1 and ADA0M2.ADA0TMD0 bits.
(1) Software trigger mode
When the ADA0M0.ADA0CE bit is set to 1, the signal of the analog input pin (ANI0 to ANI15 pin) specified by
the ADA0S register is converted. When conversion is complete, the result is stored in the ADA0CRn register.
At the same time, the A/D conversion end interrupt request signal (INTAD) is generated.
If the operation mode specified by the ADA0M0.ADA0MD1 and ADA0M0.ADA0MD0 bits is the continuous
select/scan mode, the next conversion is started, unless the ADA0CE bit is cleared to 0 after completion of the
first conversion. Conversion is performed once and ends if the operation mode is the one-shot select/scan
mode.
When conversion is started, the ADA0M0.ADA0EF bit is set to 1 (indicating that conversion is in progress).
If the ADA0M0, ADA0M2, ADA0S, ADA0PFM, or ADA0PFT register is written during conversion, the
conversion is aborted and started again from the beginning. However, writing these registers is prohibited in
the normal conversion mode and one-shot select mode/one-shot scan mode of the high-speed conversion
mode.
(2) External trigger mode
In this mode, converting the signal of the analog input pin (ANI0 to ANI15) specified by the ADA0S register is
started when an external trigger is input (to the ADTRG pin). Which edge of the external trigger is to be
detected (i.e., the rising edge, falling edge, or both rising and falling edges) can be specified by using the
ADA0M0.ADA0ETS1 and ADA0M0.ATA0ETS0 bits. When the ADA0CE bit is set to 1, the A/D converter waits
for the trigger, and starts conversion after the external trigger has been input.
When conversion is completed, the result of conversion is stored in the ADA0CRn register, regardless of
whether the continuous select, continuous scan, one-shot select, or one-shot scan mode is set as the
operation mode by the ADA0MD1 and ADA0MD0 bits. At the same time, the INTAD signal is generated, and
the A/D converter waits for the trigger again.
When conversion is started, the ADA0EF bit is set to 1 (indicating that conversion is in progress). While the
A/D converter is waiting for the trigger, however, the ADA0EF bit is cleared to 0 (indicating that conversion is
stopped). If the valid trigger is input during the conversion operation, the conversion is aborted and started
again from the beginning.
If the ADA0M0, ADA0M2, ADA0S, ADA0PFM, or ADA0PFT register is written during the conversion operation,
the conversion is not aborted, and the A/D converter waits for the trigger again.
However, writing these
registers is prohibited in the one-shot select mode/one-shot scan mode.
Caution
To select the external trigger mode, set the high-speed conversion mode. Do not input a
trigger during stabilization time that is inserted once after the A/D conversion operation is
enabled (ADA0M0.ADA0CE bit = 1).
Remark
The trigger standby status means the status after the stabilization time has elapsed.