SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
11.4 COMPARATOR MODE REGISTER
09EH
CM2M
Read/Write
After Reset
Bit 7
CM2EN
R/W
Bit 6
CM2OEN
R/W
Bit 5
CM2OUT
Bit 4
CM2SF
R/W
Bit 3
CM2G
R/W
0
Bit 2
CM2RS2
R/W
Bit 1
CM2RS1
R/W
Bit 0
CM2RS0
R/W
R
0
0
0
0
0
0
0
Bit [2:0] CM2RS[2:0]: Comparator positive terminal voltage source select bit.
000 = CM2P pin is comparator positive input pin, and GPIO function is isolated.
001 = Internal 0.2*Vdd. CM2P pin is GPIO mode.
010 = Internal 0.3*Vdd. CM2P pin is GPIO mode.
011 = Internal 0.4*Vdd. CM2P pin is GPIO mode.
100 = Internal 0.5*Vdd. CM2P pin is GPIO mode.
101 = Internal 0.6*Vdd. CM2P pin is GPIO mode.
110 = Internal 0.7*Vdd. CM2P pin is GPIO mode.
111 = Internal 0.8*Vdd. CM2P pin is GPIO mode.
Bit 3
Bit 4
Bit 5
Bit 6
Bit 7
CM2G: Comparator output trigger direction control bit.
0 = Falling edge trigger. Comparator output status is from high to low as CM2P < CM2N.
1 = Rising edge trigger. Comparator output status is from low to high as CM2P > CM2N.
CM2SF: Comparator 2 special mode control bit.
0 = Disable. Comparator 2 is normal comparator function.
1 = Enable. Comparator 2 output edge triggers TC0 pulse generator stopping.
CM2OUT: Comparator 2 output flag bit.
0 = CM2P voltage is less than CM2N voltage.
1 = CM2P voltage is larger than CM2N voltage.
CM2OEN: Comparator 2 output pin control bit.
0 = Disable. CM2O is GPIO mode.
1 = Enable. CM2O is comparator output pin and isolate GPIO function.
CM2EN: Comparator 2 control bit.
0 = Disable. Comparator pins are GPIO mode.
1 = Enable. CM2N pin is comparator mode. CM2O is controlled by CM2OEN bit. CM2P is controlled by
CM2RS[2:0]bits.
09BH
CMDB1
Read/Write
After Reset
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
CM2D3
R/W
Bit 2
CM2D2
R/W
Bit 1
CM2D1
R/W
Bit 0
CM2D0
R/W
-
-
-
-
-
-
-
-
-
-
-
-
0
0
0
0
Bit [7:4] CM2D[3:0]: Comparator 2 de-bounce time control bit.
0000=No delay, 0001=2/Fcpu, 0010=4/Fcpu, 0011=6/Fcpu, 0100=8/Fcpu, 0101=10/Fcpu,
0110=12/Fcpu,0111=14/Fcpu, 1000=16/Fcpu, 1001=18/Fcpu, 1010=20/Fcpu, 1011=22/Fcpu,
1100=24/Fcpu, 1101=26/Fcpu, 1110=28/Fcpu, 1111=30/Fcpu
SONiX TECHNOLOGY CO., LTD
Page 105
Version 2.0