Users Manual

Table Of Contents
R01UH0823EJ0110 Rev.1.10 Page 1665 of 1852
Nov 30, 2020
RX23W Group 47. Comparator B (CMPBa)
Figure 47.4 shows an operation example of comparator Bn (n = 2, 3) when the window function is enabled.
The internal reference voltage (VRFH/VRFL) for the window function and the analog input voltage are compared. The
CPBnOUT bit is set to 1 when VRFL < the analog input voltage < VRFH, and the CPBnOUT bit is set to 0 when the
analog input voltage < VRFL, or VRFH < the analog input voltage.
To use the comparator Bn interrupt, set the CPB1INT.CPBnINTEN bit to 1 (interrupt enabled). If the comparison result
changes at this time, a comparator Bn interrupt request is generated. For details on interrupts, refer to
section 47.4,
Comparator B2 and Comparator B3 Interrupts
.
The values of the registers should not be changed during comparison.
Figure 47.4 Operating Example of Comparator Bn When Window Function is Enabled (n = 2, 3)
0
Analog input voltage (V)
Reference input voltage
(VRFH)
Set to 0 by program,
or becomes 0 when the interrupt request is accepted
by the interrupt request destination
CMPBn
Reference input voltage
(VRFL)
CPB1FLG.CPB2OUT flag
CPB1FLG.CPB3OUT flag
IR104.IR flag (comparator B2)
IR105.IR flag (comparator B3)
The above figure applies when the following conditions are met.
CPB1F.CPBnFEN bit = 0 (without filter)
CPB1INT.CPBnINTEG bit = 1 (both edges)