Conversion Mode And Analog Input Pin Settings; A/D Conversion Operations And Control Procedures - Epson S1C17W03 Technical Manual

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

19 12-BIT A/D CONVERTER (ADC12A)

19.4.3 Conversion Mode and Analog Input Pin Settings

The ADC12A can be put into two conversion modes shown below using the ADC12_nTRG.CNVMD bit. Each
mode allows setting of analog input pin range to be A/D converted. The analog input pin range can be set using the
ADC12_nTRG.STAAIN[2:0] bits for specifying the first analog input pin and the ADC12_nTRG.ENDAIN[2:0]
bits for specifying the last analog input pin. The analog input signals within the specified range are A/D converted
successively in ascending order of the pin numbers.
One-time conversion mode
Once the ADC12A executes A/D conversion for all the analog input signals within the specified range, it is au-
tomatically stopped.
Continuous conversion mode
The ADC12A repeatedly executes A/D conversion within the specified range until 0 is written to the ADC12_
nCTL.ADST bit.

19.4.4 A/D Conversion Operations and Control Procedures

The following shows A/D conversion control procedures and the ADC12A operations.
Control procedure in one-time conversion mode
1. Write 1 to the ADC12_nCTL.ADST bit.
2. Wait for an ADC12A interrupt.
i. If the ADC12_nINTF.ADmCIF bit = 1 (analog input signal m A/D conversion completion interrupt), clear
the ADC12_nINTF.ADmCIF bit and then go to Step 3.
ii. If the ADC12_nINTF.ADmOVIF bit = 1 (analog input signal m A/D conversion result overwrite error inter-
rupt), clear the ADC12_nINTF.ADmOVIF bit and terminate as an error or retry A/D conversion.
3. Read the A/D conversion result of the analog input m (ADC12_nADmD.ADmD[15:0] bits).
The 12-bit conversion results are located at the low-order 12 bits or high-order 12-bits within the ADC12_
*
nADmD.ADmD[15:0] bits according to the ADC12_nTRG.STMD bit setting.
4. Repeat Steps 2 and 3 until A/D conversion for all the analog input pins within the specified range is completed.
5. To forcefully terminate the A/D conversion being executed, write 0 to the ADC12_nCTL.ADST bit.
The ADC12A stops operating after the A/D conversion currently being executed has completed.
The ADC12_nCTL.ADST bit must be cleared by writing 0 even if A/D conversion is completed and automati-
cally stopped.
Control procedure in continuous conversion mode
1. Write 1 to the ADC12_nCTL.ADST bit.
2. Wait for an ADC12A interrupt.
i. If the ADC12_nINTF.ADmCIF bit = 1 (analog input signal m A/D conversion completion interrupt), clear
the ADC12_nINTF.ADmCIF bit and then go to Step 3.
ii. If the ADC12_nINTF.ADmOVIF bit = 1 (analog input signal m A/D conversion result overwrite error inter-
rupt), clear the ADC12_nINTF.ADmOVIF bit and terminate as an error or retry A/D conversion.
3. Read the A/D conversion result of the analog input m (ADC12_nADmD.ADmD[15:0] bits).
4. Repeat Steps 2 and 3 until terminating A/D conversion.
5. Write 0 to the ADC12_nCTL.ADST bit.
The ADC12A stops operating after the A/D conversion currently being executed has completed.
19-4
Seiko Epson Corporation
S1C17W03/W04 TECHNICAL MANUAL
(Rev. 1.2)

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17w04

Table of Contents