
CHAPTER 12 A/D CONVERTER
User’s Manual U19780EJ2V0UD
346
The setting methods are described below.
<1> Select the conversion time by using bits 5 to 1 (FR2 to FR0, LV1, and LV0) of ADM, and select the operation
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.
<4> Set the channel to be used in the analog input mode by using bits 4 to 0 (ADPC4 to ADPC0) of the A/D port
configuration register (ADPC), bits 7 to 0 (PM27 to PM20) of port mode register 2 (PM2), and bit 3 to 0
(PM83 to PM80) of port mode register 8 (PM8).
<5> Select a channel to be used by using bits 3 to 0 (ADS3 to ADS0) of the analog input channel specification
register (ADS).
<6> Use the bits 0 and 7 (ADTRS, ADTMD) of the A/D converter mode register 1 (ADM1) to set the trigger
mode.
<7> In software trigger mode:
→
Set bit 7 (ADCS) of ADM to 1 to start A/D conversion.
In timer trigger mode:
→
ADCS is automatically set to 1 and A/D conversion starts when the timer trigger signal is generated.
<8> When one A/D conversion has been completed, an interrupt request signal (INTAD) is generated.
<9> Transfer the A/D conversion data to the A/D conversion result register (ADCR, ADCRH).
<10> In successive conversion mode:
→
The next A/D conversion starts automatically.
In single conversion mode:
→
The A/D converter enters the wait status. To start another A/D conversion, go to step <7>.
<Change the channel>
<11> Select the channel using bits 3 to 0 (ADS3 to ADS0) of ADS
Note
.
<12> When one A/D conversion has been completed, an interrupt request signal (INTAD) is generated.
<13> Transfer the A/D conversion data to the A/D conversion result register (ADCR, ADCRH).
<Complete A/D conversion>
<14> Clear ADCS to 0.
<14> In software trigger mode:
→
Clear ADCE to 0.
In timer trigger mode:
→
Clear ADCE and ADTMD to 0.
Note
In timer trigger mode (single conversion mode), A/D conversion continues even if bits 3 to 0 of ADS are set
during A/D conversion. The channel will be switched at the start of the next conversion. In all other
modes, A/D conversion stops when bits 3 to 0 of ADS are set. The channel is then changed and A/D
conversion starts again from the beginning.