
VII PERIPHERAL MODULES 5 (ANALOG): A/D CONVERTER (ADC)
S1C33E07 TECHNICAL MANUAL
EPSON
VII-1-7
VII
ADC
Setting the upper-limit and lower-limit values (advanced mode)
The advanced mode allows a range check of the conversion results by setting the upper-limit and lower-limit
values. Setup the A/D converter according to the procedure shown below to use this function.
1. Selecting the channel
Select the channel to compare the A/D conversion results and the upper-limit and lower-limit value using
ADCMP[2:0] (D[14:12]/0x300544).
ADCMP[2:0]: A/D Upper/Lower-limit Comparison Channel Select Bits in the A/D Control/Status Register
(D[14:12]/0x300544)
Table VII.1.4.5 Selecting the Channel for Checking Conversion Results
ADCMP1
0
1
0
ADCMP0
0
1
0
1
0
Channel selected
AIN4
AIN3
AIN2
AIN1
AIN0
Reserved
ADCMP2
1
0
Other
2. Setting upper-limit and lower-limit values
Set the upper-limit value to ADUPR[9:0] (D[9:0]/0x300558) and the lower-limit value to ADLWR[9:0]
(D[9:0]/0x30055A).
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)
When the conversion result exceeds the upper-limit value set or is lower than the lower-limit value, it is
determined as out of range. If the conversion result is the same value as the upper-limit or lower-limit value,
it is determined as within the range.
3. Enabling comparison with the upper-limit and lower-limit values
Set ADCMPE (D15/0x300544) to 1 to enable the range check function.
ADCMPE: A/D Upper/Lower-limit Comparison Enable Bit in the A/D Control/Status Register (D15/0x300544)
Setting the interrupt mode (advanced mode)
The interrupt functions are extended in the advanced mode, so the following configuration is necessary.
1. Enabling/disabling the conversion-complete interrupt
The conversion-complete interrupt can be enabled/disabled using CNVINTEN (D4/0x300544). Set
CNVINTEN to 1 when using the conversion-complete interrupt, or to 0 when it is not used. At initial reset,
CNVINTEN is set to 1, so the conversion-complete interrupt function is enabled.
CNVINTEN: A/D Conversion-Complete Interrupt Enable Bit in the A/D Control/Status Register (D4/0x300544)
2. Enabling/disabling the out-of-range interrupt
The out-of-range interrupt can be enabled/disabled using CMPINTEN (D5/0x300544). Set CMPINTEN to
1 when using the out-of range interrupt, or to 0 when it is not used. At initial reset, CMPINTEN is set to 0,
so the out-of-range interrupt function is disabled.
CMPINTEN: A/D Out-of-Range Interrupt Enable Bit in the A/D Control/Status Register (D5/0x300544)
3. Setting the interrupt signal mode
The S1C33E07 A/D converter has two interrupt request outputs for the interrupt sources above and each
interrupt can be handled individually. The A/D converter with advanced mode in the C33 STD Core model uses
one signal line for interrupt requests to the ITC. In the initial setting, the out-of-range interrupt signal is ORed
with the conversion-complete interrupt signal to send to the ITC. The S1C33E07 A/D converter also supports
this interrupt signal mode. So, the cause of conversion-complete interrupt flag in the ITC is set when an A/D
conversion has completed or when the conversion results are out of range. This signal mode can be canceled
using INTMODE (D6/0x300544). To handle each interrupt individually, set INTMODE (D6/0x300544) to 1.
In this setting, the out-of-range interrupt signal is not ORed with the conversion-complete interrupt signal.
INTMODE: Interrupt Signal Mode Select Bit in the A/D Control/Status Register (D6/0x300544)