IV ANALOG BLOCK: A/D CONVERTER
When a trigger is input, the A/D converter samples and
Upon completion of the A/D conversion in that channel, the A/D converter stores the conversion result, in 10- bit data registers ADD[9:0] (ADD[9:8] = D[1:0]/0x40241, ADD[7:0] = D[7:0]/0x40240), and sets the
The ADST used for the software trigger is set to "1" during A/D conversion, even when it is started by some other trigger, so it can be used as an
The channel in which conversion is underway can be identified by reading CH[2:0] (D[2:0]) / A/D trigger register (0x40242).
Reading out A/D conversion results
As explained earlier, the results of A/D conversion are stored in the ADD[9:0] register each time conversion in one channel is completed. Since an interrupt can be generated simultaneously, this interrupt is normally used to read out the converted data. In addition, be sure to reset the interrupt factor flag (by writing "0") to prepare the A/D converter for the next operation.
Since the interrupt factor of the A/D converter can also be used to invoke DMA, the conversion results can automatically be transferred to a specified memory location.
If multiple A/D conversion channels are specified, the conversion results in one channel must be read out prior to completion of conversion in the next channel. If the A/D conversion currently under way is completed before the previous conversion results are read out, the ADD[9:0] register is overwritten with the new conversion results.
If ADD[9:0] is updated when the
Terminating A/D conversion
•For normal mode (MS = "1")
In the normal mode, A/D conversion is performed successively from the conversion start channel specified using CS[2:0] to the conversion end channel specified using CE[2:0], and is completed after these conversions are executed in one operation. ADST is reset to "0" upon completion of the conversion.
•For continuous mode (MS = "0")
In the continuous mode, A/D conversion from the
writing "0" to ADST.
When conversion is completed normally, ADF is set to "1" and conversion result is obtained. On the other hand, when it is forcibly stopped, ADF register keep the previous value and a conversion result is not obtained.
•Forced termination
A/D conversion can only be stopped by writing "0" to ADST in continuous mode. At this time it is not possible to acquire the value of the conversion that was in progress.
A/D conversion cannot be stopped by writing "0" to ADST in normal mode.
Note that A/D conversion cannot be stopped by writing "0" to ADE during a conversion (when ADST is "1").
Note: Once A/D conversion ends, further A/D conversion will not be performed correctly if restarted within an interval shorter than one cycle of the A/D converter operating clock set by the prescaler.
EPSON | S1C33210 FUNCTION PART |