SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
10.4 COMPARATOR MODE REGISTER
09DH
CM1M
Read/Write
After Reset
Bit 7
CM1EN
R/W
Bit 6
CM1OEN
R/W
Bit 5
CM1OUT
Bit 4
CM1SF
R/W
Bit 3
CM1G
R/W
0
Bit 2
CM1RS2
R/W
Bit 1
CM1RS1
R/W
Bit 0
CM1RS0
R/W
R
0
0
0
0
0
0
0
Bit [2:0] CM1RS[2:0]: Comparator positive terminal voltage source select bit.
000 = CM1P pin is comparator positive input pin, and GPIO function is isolated.
001 = Internal 0.2*Vdd. CM1P pin is GPIO mode.
010 = Internal 0.3*Vdd. CM1P pin is GPIO mode.
011 = Internal 0.4*Vdd. CM1P pin is GPIO mode.
100 = Internal 0.5*Vdd. CM1P pin is GPIO mode.
101 = Internal 0.6*Vdd. CM1P pin is GPIO mode.
110 = Internal 0.7*Vdd. CM1P pin is GPIO mode.
111 = Internal 0.8*Vdd. CM1P pin is GPIO mode.
Bit 3
Bit 4
Bit 5
Bit 6
Bit 7
CM1G: Comparator output trigger direction control bit.
0 = Falling edge trigger. Comparator output status is from high to low as CM1P < CM1N.
1 = Rising edge trigger. Comparator output status is from low to high as CM1P > CM1N.
CM1SF: Comparator 1 special mode control bit.
0 = Disable. Comparator 1 is normal comparator function.
1 = Enable. Comparator 1 output edge triggers TC0 pulse generator stopping.
CM1OUT: Comparator 1 output flag bit.
0 = CM1P voltage is less than CM1N voltage.
1 = CM1P voltage is larger than CM1N voltage.
CM1OEN: Comparator 1 output pin control bit.
0 = Disable. CM1O is GPIO mode.
1 = Enable. CM1O is comparator output pin and isolate GPIO function.
CM1EN: Comparator 1 control bit.
0 = Disable. Comparator pins are GPIO mode.
1 = Enable. CM1N pin is comparator mode. CM1O is controlled by CM1OEN bit. CM1P is controlled by
CM1RS[2:0]bits.
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 [7:4] CM1D[3:0]: Comparator 1 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 99
Version 2.0