R01UH0822EJ0100 Rev.1.00
Page 898 of 1041
Jul 31, 2019
RX13T Group
28. Comparator C (CMPC)
28.3.5
Comparator Setting Flowchart
shows the flowchart for setting the comparator-related registers.
Figure 28.5
Comparator Operation Setting Flowchart
Figure 28.6
Comparator Operation Termination Flowchart
Start
Set D/A converter for
generating reference voltage
Set CMPSEL0.CMPSEL[3:0]
bits
Set CMPCTL register
HCMPON bit = 1
COE bit = 1
CPOE bit = 1
Operation started
Set COMPn pin
Set interrupts
Set CMPSEL1.CVRS[1:0] bits
Set D/A converter for generating reference voltage.*
(Refer to section 27, D/A Converter for Generating Comparator C
Reference Voltage (DA).)
Set comparator input.
Set comparator reference voltage.
Set comparator control (set bits CDFS[1:0], CINV, and CEG[1:0]).
Enable comparator operation.
(after enabling, comparator operation stabilization wait time is required. As
for the value, refer to section 32, Electrical Characteristics.)
Enable comparator output.
Set COMPn pin for comparator output.*
(Refer to section 28.3.4, Comparator Pin Output)
Enable comparator external pin output.*
Set interrupts.
n = 0 to 2
Note 1. This is not required when the external reference voltage is used.
Note 2. This is not required when the comparison result is not output to the external pin.
Operation termination start
CEG[1:0] bits = 00b
CPOE bit = 0
COE bit = 0
HCMPON bit = 0
End
Disable generating an interrupt request.
Disable comparator external pin output.
Disable comparator output.
Disable comparator operation.