
Vii PeRiPheRaL MoDuLes 5 (anaLoG): a/D ConVeRteR (aDC)
s1C33L17 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/DUpper/Lower-limitComparisonChannelSelectBitsintheA/DControl/StatusRegister
(D[14:12]/0x300544)
TableVII.1.4.5SelectingtheChannelforCheckingConversionResults
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/DUpperLimitValueSetupBitsintheA/DUpperLimitValueRegister(D[9:0]/0x300558)
aDLWR[9:0]:A/DLowerLimitValueSetupBitsintheA/DLowerLimitValueRegister(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/DUpper/Lower-limitComparisonEnableBitintheA/DControl/StatusRegister(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/DConversion-CompleteInterruptEnableBitintheA/DControl/StatusRegister(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/DOut-of-RangeInterruptEnableBitintheA/DControl/StatusRegister(D5/0x300544)
3. setting the interrupt signal mode
The S1C33L17 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 S1C33L17 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:InterruptSignalModeSelectBitintheA/DControl/StatusRegister(D6/0x300544)