Datasheet
78K0/Ix2 CHAPTER 13 COMPARATORS
R01UH0010EJ0500 Rev.5.00 423
Feb 28, 2012
13.4 Operation of Comparators
13.4.1 Starting comparator operation (using internal referen
ce voltage for comparator reference voltage)
Figure 13-11. Example of Setting Procedure when Starting Comparator Operation
(Using Internal Reference Voltage for Comparator Reference Voltage)
CVRE bit setting
CMPnEN bit setting
CnCTL register setting
Operation start
Setting (1) the CVRE bit of C0RVM and enabling
the internal reference voltage generation
operation.
CnRVM register setting
Select the internal reference voltage level by using
the CnVRS0 to CnVRS4 bits of CnRVM.
Enable the comparator operation by setting (1) the
CMPnEN bit of CnCTL. Input to the CMPn+ pin will be
enabled at the same time.
PM2 register setting
Setting the pin to be used as
a comparator input to input mode.
Setting the pin to be used as
a comparator input to analog input.
ADPC0 register setting
Use the CnINV bit of CnCTL to select forwarding or
reversing of the output. Setting the internal reference
voltage to be used by using the CnMODSEL0 and
CnMODSEL1 bits. Use the CnDFS0 and CnDFS1 bits
to select the noise elimination width.
(Output disabled state)
Setting (1) the CnOE bit of CnCTL and enabling the
comparator output.
CnOE bit setting
Note
Start
Note Set the CnOE bit to 1 when at least 20
s have elapsed after having set the CVRE register.