SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
9.4 COMPARATOR MODE REGISTER
09CH
CM0M
Read/Write
After Reset
Bit 7
CM0EN
R/W
Bit 6
CM0OEN
R/W
Bit 5
CM0OUT
Bit 4
CM0SF
R/W
Bit 3
CM0G
R/W
0
Bit 2
Bit 1
Bit 0
-
-
-
-
-
-
-
-
-
R
0
0
0
0
Bit 3
Bit 4
Bit 5
Bit 6
Bit 7
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.
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.
CM0OUT: Comparator 0 output flag bit.
0 = CM0P voltage is less than CM0N voltage.
1 = CM0P voltage is larger than CM0N voltage.
CM0OEN: Comparator 0 output pin control bit.
0 = Disable. CM0O is GPIO mode.
1 = Enable. CM0O is comparator output pin and isolate GPIO function.
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
CMDB0
Read/Write
After Reset
Bit 7
CM1D3
R/W
Bit 6
CM1D2
R/W
Bit 5
CM1D1
R/W
Bit 4
CM1D0
R/W
Bit 3
CM0D3
R/W
Bit 2
CM0D2
R/W
Bit 1
CM0D1
R/W
Bit 0
CM0D0
R/W
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.
Comparator
Output
CMnO
Comparator
Negative Input
CMnN
CMnP
0.1uF
0.1uF
MCU
Comparator
Positive Input
SONiX TECHNOLOGY CO., LTD
Page 93
Version 2.0