
CHAPTER 13 A/D CONVERTER
Preliminary User’s Manual U16541EJ1V0UM
354
13.4.2 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 ADA0TMD bit of the ADA0M0 register is used to set the trigger mode. The hardware
trigger modes are set by the ADA0TMD1 and ADA0TMD0 bits of the ADA0M2 register.
(1) Software trigger mode
When the ADA0CE bit of the ADA0M0 register is set to 1, the signal of the analog input pin (ANI0 to ANI11 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 ADA0MD1 and ADA0MD0 bits of the ADA0M0 register 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 completed if the operation mode is the one-shot
select/scan mode.
When conversion is started, the ADA0EF bit is set to 1 (indicating that the operation 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.
(2) External trigger mode
In this mode, converting the signal of the analog input pin (ANI0 to ANI11 pin) specified by the ADA0S register
is started when an external trigger is input (to the ADTRG pin). How the edge of the external trigger is to be
detected (i.e., whether the rising edge, falling edge, or both rising and falling edges are to be detected) can be
specified by using the ADA0ETS1 and ATA0ETS0 bits of the ADA0M0 register. When the ADA0CE bit of the
ADA0M0 register 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. At the same time,
the A/D conversion end interrupt request signal (INTAD) 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 the operation is in progress). While the
A/D converter is waiting for the trigger, however, the ADA0EF bit is cleared to 0 (indicating that the operation 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.