
CHAPTER 12 A/D CONVERTER
User’s Manual U19780EJ2V0UD
339
12.4 A/D Converter Operations
12.4.1 Basic operations of A/D converter
<1> Specify the A/D conversion time by using bits 5 to 1 (FR2 to FR0, LV1, and LV0) of ADM, and the operating
mode by using bit 6 (ADSCM).
<2> Specify the source of the reference voltage for the A/D converter and whether to enable operation of the A/D
converter voltage booster by using bits 7 and 1 (ADREF and VRGV) of the analog reference voltage control
register (ADVRC).
<3> Set bit 0 (ADCE) of the A/D converter mode register (ADM) to 1 to start the operation of the A/D voltage
comparator.
<4> Set channels for A/D conversion to analog input by using the A/D port configuration register (ADPC) and set to
input mode by using port mode registers (PM2, PM8).
<5> Select one channel for A/D conversion using the analog input channel specification register (ADS).
<6> Use the A/D converter mode register 1 (ADM1) to set the trigger mode.
<7> If software trigger mode was set as the trigger mode in <6>, A/D conversion is started by setting bit 7 of ADM
(ADCS) to 1.
If timer trigger mode was set as the trigger mode in <6>, A/D conversion is started when the timer trigger signal
is detected.
<8> The voltage input to the selected analog input channel is sampled by the sample & hold circuit.
<9> When sampling has been done for a certain time, the sample & hold circuit is placed in the hold state and the
sampled voltage is held until the A/D conversion operation has ended.
<10> Bit 11 of the successive approximation register (SAR) is set. The series resistor string voltage tap is set to (1/2)
AV
REF
by the tap selector.
<11> The voltage difference between the series resistor string voltage tap and sampled voltage is compared by the
A/D voltage comparator. If the analog input is greater than (1/2) AV
REF
, the MSB of SAR remains set to 1. If the
analog input is smaller than (1/2) AV
REF
, the MSB is reset to 0.
<12> Next, bit 10 of SAR is automatically set to 1, and the operation proceeds to the next comparison. The series
resistor string voltage tap is selected according to the preset value of bit 11, as described below.
•
Bit 11 = 1: (3/4) AV
REF
•
Bit 11 = 0: (1/4) AV
REF
The voltage tap and sampled voltage are compared and bit 10 of SAR is manipulated as follows.
•
Analog input voltage
≥
Voltage tap: Bit 10 = 1
•
Analog input voltage < Voltage tap: Bit 10 = 0
<13> Comparison is continued in this way up to bit 0 of SAR.
<14> Upon completion of the comparison of 12 bits, an effective digital result value remains in SAR, and the result
value is transferred to the A/D conversion result register (ADCR, ADCRH) and then latched.
At the same time, the A/D conversion end interrupt request (INTAD) can also be generated.