R01UH0823EJ0100 Rev.1.00
Page 1646 of 1823
Jul 31, 2019
RX23W Group
47. Comparator B (CMPBa)
shows an operating example of comparator Bn (n = 2, 3) when window function is disabled.
The reference input voltage (CVREFB2/CVREFB3 or internal reference voltage) and the analog input voltage are
compared. If the analog input voltage is higher than the reference input voltage, the CPB1FLG.CPBnOUT bit is set to 1.
If the analog input voltage is lower than the reference input voltage, the CPBnOUT bit is set to 0.
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
Comparator B2 and Comparator B3 Interrupts
.
The values of the registers should not be changed during comparison.
Figure 47.3
Operating Example of Comparator Bn When Window Function is Disabled (n = 2, 3)
0
Analog input voltage (V)
Reference input voltage
Set to 0 by program,
or becomes 0 when the interrupt request is accepted
by the interrupt request destination
CMPBn
The above figure applies when the following conditions are met.
CPB1F.CPBnFEN bit = 0 (without filter)
CPB1INT.CPBnINTEG bit = 1 (both edges)
CPB1FLG.CPB2OUT flag
CPB1FLG.CPB3OUT flag
IR104.IR flag (comparator B2)
IR105.IR flag (comparator B3)