R01UH0823EJ0100 Rev.1.00
Page 1564 of 1823
Jul 31, 2019
RX23W Group
44. 12-Bit A/D Converter (S12ADE)
44.2.22
A/D Compare Function Window A Comparison Condition Setting Register 0
(ADCMPLR0)
The ADCMPLR0 register sets the condition for use in comparing the values of the ADCMPDR0 and ADCMPDR1
registers with results of A/D conversion. The ADCMPLR0 register should be set while ADCSR.ADST bit is 0.
CMPLCHA0n Bit (n = 00 to 07) (Compare Window A Comparison Condition Select)
This bit sets the condition for use in comparison with the selected channel from among AN000 to AN007 to which
compare window A conditions are applied. A condition can be set for individual comparison of each analog input.
The CMPLCHA000 bit is used for AN000, the CMPLCHA007 bit is used for AN007.
When the result of comparison matches the set condition, the ADCMPSR0.CMPSTCHA0n flag is set to 1.
shows the comparison conditions.
Figure 44.3
Explanation of Compare Function Window A Comparison Conditions
Address(es): S12AD.ADCMPLR0 0008 9098h
b15
b14
b13
b12
b11
b10
b9
b8
b7
b6
b5
b4
b3
b2
b1
b0
—
—
—
—
—
—
—
—
CMPLC
HA007
CMPLC
HA006
CMPLC
HA005
CMPLC
HA004
CMPLC
HA003
CMPLC
HA002
CMPLC
HA001
CMPLC
HA000
Value after reset:
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Bit
Symbol
Bit Name
Description
R/W
b0
Compare Window A
Comparison Condition Select
When the window function is disabled
(ADCMPCR.WCMPE bit = 0):
0: ADCMPDR0 register value > A/D-converted value
1: ADCMPDR0 register value < A/D-converted value
When the window function is enabled
(ADCMPCR.WCMPE bit = 1):
0: A/D-converted value < ADCMPDR0 register value or
A/D-converted value > ADCMPDR1 register value
1: ADCMPDR0 register value < A/D-converted value <
ADCMPDR1 register value
R/W
b1
R/W
b2
R/W
b3
R/W
b4
R/W
b5
R/W
b6
R/W
b7
R/W
b15 to b8
—
Reserved
These bits are read as 0. The write value should be 0.
R/W
(1) Comparison conditions when the window function is disabled
CMPLCHA0n = 0
CMPLCHA0n = 1
ADCMPDR0 value ≤ A/D converted value
Not met
ADCMPDR0 value < A/D converted value
Met
ADCMPDR0 value > A/D converted value
Met
ADCMPDR0 value ≥ A/D converted value
Not met
(2) Comparison conditions when the window function is enabled
CMPLCHA0n = 0
ADCMPDR1 value < A/D-converted value
Met
ADCMPDR0 value ≤ A/D-converted value ≤ ADCMPDR1 value
Not met
A/D-converted value < ADCMPDR0 value
Met
CMPLCHA0n = 1
ADCMPDR1 value ≤ A/D-converted value
Not met
ADCMPDR0 value < A/D-converted value < ADCMPDR1 value
Met
A/D-converted value ≤ ADCMPDR0 value
Not met