SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 93
Version 2.0
9.4 COMPARATOR MODE REGISTER
09CH
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
CM0M
CM0EN
CM0OEN
CM0OUT
CM0SF
CM0G
-
-
-
Read/Write
R/W
R/W
R
R/W
R/W
-
-
-
After Reset
0
0
0
0
0
-
-
-
Bit 3
CM0G:
Comparator output trigger direction control bit.
0 = Falling edge trigger. Comparator output status is from high to low as CM0P < CM0N.
1 = Rising edge trigger. Comparator output status is from low to high as CM0P > CM0N.
Bit 4
CM0SF:
Comparator 0 special mode control bit.
0 = Disable. Comparator 0 is normal comparator function.
1 = Enable. Comparator 0 output edge triggers TC0 pulse generator.
Bit 5
CM0OUT:
Comparator 0 output flag bit.
0 = CM0P voltage is less than CM0N voltage.
1 = CM0P voltage is larger than CM0N voltage.
Bit 6
CM0OEN:
Comparator 0 output pin control bit.
0 = Disable. CM0O is GPIO mode.
1 = Enable. CM0O is comparator output pin and isolate GPIO function.
Bit 7
CM0EN:
Comparator 0 control bit.
0 = Disable. Comparator pins are GPIO mode.
1 = Enable. CM0N and CM0P pins are comparator mode. CM0O is controlled by CM0OEN bit.
09AH
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
CMDB0
CM1D3
CM1D2
CM1D1
CM1D0
CM0D3
CM0D2
CM0D1
CM0D0
Read/Write
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
After Reset
0
0
0
0
0
0
0
0
Bit [3:0]
CM0D[3:0]:
Comparator 0 de-bounce time control bit.
0000=No delay, 0001=1/Fhosc, 0010=2/Fhosc, 0011=3/Fhosc, 0100=4/Fhosc, 0101=5/Fhosc,
0110=6/Fhosc, 0111=7/Fhosc, 1000=8/Fhosc, 1001=9/Fhosc, 1010=10/Fhosc, 1011=11/Fhosc,
1100=12/Fhosc, 1101=13/Fhosc, 1110=14/Fhosc, 1111=15/Fhosc.
9.5 COMPARATOR APPLICATION NOTICE
The comparator is to compares the positive voltage and negative voltage to output result. The positive and negative
sources are analog signal. In hardware application circuit, the comparator input pins must be connected a 0.1uF
comparator to reduce power noise and make the input signal more stable. The application circuit is as following.
MCU
CMnN
0.1uF
CMnP
0.1uF
CMnO
Comparator
Output
Comparator
Negative Input
Comparator
Positive Input