R01UH0823EJ0100 Rev.1.00
Page 1604 of 1823
Jul 31, 2019
RX23W Group
44. 12-Bit A/D Converter (S12ADE)
44.3.5.2
ELC Output of Compare Function
The ELC output of the compare function is used to specify the high-side reference value and the low-side reference value
for window A and window B respectively, and to compare the A/D converted value of the selected channel with the high/
low-side reference value. Depending on whether the comparison conditions for window A and window B are met or not
met, the ELC event (S12ADWMELC/S12ADWUMELC) is output according to the event conditions (A or B, A and B,
A exor B).
If multiple channels are selected for window A, when the comparison conditions for any of the channels are met, it is
recognized that the comparison conditions for window A are met.
When using this function, perform A/D conversion in single scan mode.
Any channels from AN000 to AN007, AN016 to AN020, AN027, internal reference voltage, and temperature sensor
output are selectable for window A.
However, when selecting the internal reference voltage or the temperature sensor output, it cannot be selected together
with any other channel. Any channels from AN000 to AN007, AN016 to AN020, AN027, internal reference voltage, and
temperature sensor output are selectable for window B.
The setting procedure is as follows when this function is to be used. The setting procedure required for normal A/D
conversion in single scan mode is omitted.
(1) Confirm that the value of the ADCSR.ADCS[1:0] bits is 00b (single scan mode).
(2) Select channels (from among AN000 to AN007, AN016 to AN020, AN027, temperature sensor, and internal
reference voltage) in the ADCMPANSR0/ADCMPANSR1 or ADCMPANSER register (for window A) and in the
ADCMPBNSR register (for window B).
(3) Set window comparison conditions in the ADCMPLR0, ADCMPLR1, ADCMPLER, and ADCMPBNSR registers,
and set the upper-limit and lower-limit reference values in the ADCMPDR0, ADCMPDR1, ADWINULB, and
ADWINLLB registers.
(4) Set composite conditions for window A/B, window A/B operation enable, and interrupt output enable in the
ADCMPCR register. A scan end event (S12ADELC) is output to the ELC at the end of each single scan. In addition,
a match or mismatch event (S12ADWMELC or S12ADWUMELC) is output with a delay of one PCLK cycle
depending on the ADCMPCR.CMPAB[1:0] setting.
Since match and mismatch events are mutually exclusive, these are not output at the same time.