
VII PERIPHERAL MODULES 5 (ANALOG): A/D CONVERTER (ADC)
S1C33E07 TECHNICAL MANUAL
EPSON
VII-1-11
VII
ADC
Advanced mode
Upon completion of the A/D conversion in the start channel (Ch.x), the A/D converter stores the conversion
result to the 10-bit Ch.x conversion result buffer ADxBUF[9:0] (D[9:0]/0x300548 + 2x) and sets the Ch.x
conversion-complete flag ADFx (Dx/0x300546) and the cause-of-interrupt flag FADE (D1/0x300287). If
multiple channels are specified using CS[2:0] (D[10:8]/0x300542) and CE[2:0] (D[13:11]/0x300542), A/D
conversions in the subsequent channels are performed in succession.
ADxBUF[9:0]: A/D Ch.x Converted Data Bits in the A/D Ch.x Conversion Result Buffer Register
(D[9:0]/0x300548 + 2x)
ADFx: A/D Ch.x Conversion-Complete Flag in the A/D Channel Status Flag Register (Dx/0x300546)
The results of A/D conversion are stored in the A/D conversion result buffer for each channel 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 cause-of-interrupt flag (by writing
0) to prepare the A/D converter for the next operation.
Since the cause of interrupt of the A/D converter can also be used to invoke DMA, the conversion results can
automatically be transferred to a specified memory location.
In the advanced mode, each channel has a conversion result buffer, so it is not necessary to read the conversion
results prior to completion of conversion in the next channel. However, if the next A/D conversion in the
same channel is completed before the previous conversion results are read out, the conversion result buffer
is overwritten with the new conversion results. If ADxBUF[9:0] (D[9:0]/0x300548 + 2x) is updated when
the conversion-complete flag ADFx = 1 (before the converted data is read out), the overwrite-error flag
OWEx (Dx + 8/0x300546) is set to 1. ADFx (Dx/0x300546) is reset to 0 when the converted data is read
out. If ADxBUF[9:0] is updated when ADFx = 0, OWEx remains at 0, indicating that the operation has been
completed normally. When reading out data, also read OWEx to make sure the data is valid. Once OWEx is set,
it remains set until it is reset to 0 by writing 0 in the software. Note also that if OWEx is set, ADFx is also set.
In this case, read out the converted data and reset ADFx.
OWEx: A/D Ch.x Overwrite Error Flag in the A/D Channel Status Flag Register (Dx + 8/0x300546)
ADD[9:0] (D[9:0]/0x300540), ADF (D3/0x300544) and OWE (D0/0x300544) used in the standard mode are
also effective in the advanced mode as well. The functions and actions of the register/bits are the same as those
of the standard mode. OWE is set during conversion in multiple-channels, but it is not necessary to reset it.
Range check (comparison with upper-limit/lower-limit values in advanced mode)
When the range check function is enabled (ADCMPE (D15/0x300544) = 1) and an A/D conversion in the
channel specified using ADCMP[2:0] (D[14:12]/0x300544) has completed, the conversion results are compared
with the contents of ADUPR[9:0] (D[9:0]/0x300558) and ADLWR[9:0] (D[9:0]/0x30055A).
ADCMPE: A/D Upper/Lower-limit Comparison Enable Bit in the A/D Control/Status Register (D15/0x300544)
ADCMP[2:0]: A/D Upper/Lower-limit Comparison Channel Select Bits in the A/D Control/Status Register
(D[14:12]/0x300544)
ADUPR[9:0]: A/D Upper Limit Value Setup Bits in the A/D Upper Limit Value Register (D[9:0]/0x300558)
ADLWR[9:0]: A/D Lower Limit Value Setup Bits in the A/D Lower Limit Value Register (D[9:0]/0x30055A)
If the conversion results exceed the upper-limit value, the upper-limit comparison status bit ADUPRST (D11/
0x300544) is set to 1. If the results are less than the lower-limit value, the lower-limit comparison status bit
ADLWRST (D10/0x300544) is set to 1. When the out-of range interrupt is enabled, an interrupt occurs if one
of the status bits has been set. This interrupt request sets the cause-of-interrupt flag FADC (D0/0x300287). Also
the same cause-of-interrupt flag FADE (D1/0x300287) as the conversion-complete interrupt is set to 1 when
INTMODE (D6/0x300544) has been set to 0.
ADUPRST: A/D Upper-limit Comparison Status Bit in the A/D Control/Status Register (D11/0x300544)
ADLWRST: A/D Lower-limit Comparison Status Bit in the A/D Control/Status Register (D10/0x300544)
FADC: A/D Out-of-Range Interrupt Cause Flag in the Port Input 4–7, RTC, A/D Interrupt Cause Flag
Register (D0/0x300287)
INTMODE: Interrupt Signal Mode Select Bit in the A/D Control/Status Register (D6/0x300544)
When the conversion results are the same as the upper-limit or lower-limit values, it is assumed within the range
and an interrupt is not generated.