SN32F100 Series
32-Bit Cortex-M0 Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 158
Version 1.9
0: Disable. P2[15:0], P3[7:0] are GPIO mode.
1 : Enable. Comparator negative input pins are controlled by CMCH[4:0]
bits.
30:15
Reserved
R
0
14
CMPOUT
Comparator output flag bit.
The comparator output status is “1” as
comparator disabled.
0 : Comparator internal reference voltage is less than CMPN voltage.
1 : Comparator internal reference voltage is larger than CMPN voltage.
R
1
13:12
Reserved
R
0
11:10
CMDB[1:0]
Comparator output debounce time select bit.
00 : 1* CMP_PCLK.
01 : 2* CMP_PCLK.
10 : 3* CMP_PCLK.
11 : No de-bounce.
R/W
0
9
CMPOEN
Comparator output pin control bit.
0 : Disable. CMO pin is GPIO mode.
1 : Enable comparator output pin. P3.8 pin exchanges to comparator
output pin (CMO pin), and GPIO function is isolated.
R/W
0
8
CMPG
Comparator interrupt trigger direction control bit.
0 : Rising edge trigger. CMPP > CMPN or comparator internal reference
voltage.
1 : Falling edge trigger. CMPP < CMPN or comparator internal reference
voltage.
R/W
0
7
Reserved
R
0
6:5
CMPS[1:0]
Comparator positive input voltage control bit.
If TCHEN=1, CMPS[1:0]
bits are useless, and the internal reference switches automatically.
00 : Internal 1/4*Vdd and enable internal reference voltage generator.
01 : Internal 1/2*Vdd and enable internal reference voltage generator.
10,11 : Internal 3/4*Vdd and enable internal reference voltage generator.
R/W
0
4:0
CMCH[4:0]
Comparator negative input pin control bit.
CMPEN must be “1”.
00000 : Comparator negative input pin is P2.0.
00001 : Comparator negative input pin is P2.1.
00010 : Comparator negative input pin is P2.2.
00011 : Comparator negative input pin is P2.3.
00100 : Comparator negative input pin is P2.4.
00101 : Comparator negative input pin is P2.5.
00110 : Comparator negative input pin is P2.6.
00111 : Comparator negative input pin is P2.7.
01000 : Comparator negative input pin is P2.8.
01001 : Comparator negative input pin is P2.9.
01010 : Comparator negative input pin is P2.10.
01011 : Comparator negative input pin is P2.11.
01100 : Comparator negative input pin is P2.12.
01101 : Comparator negative input pin is P2.13.
01110 : Comparator negative input pin is P2.14.
01111 : Comparator negative input pin is P2.15.
10000 : Comparator negative input pin is P3.0.
10001 : Comparator negative input pin is P3.1.
10010 : Comparator negative input pin is P3.2.
10011 : Comparator negative input pin is P3.3.
10100 : Comparator negative input pin is P3.4.
10101 : Comparator negative input pin is P3.5.
10110 : Comparator negative input pin is P3.6.
10111 : Comparator negative input pin is P3.7.
11000~11111 : Reserved.
R/W
0
14.4.2 Comparator Interrupt Enable register (CMP_IE)
Address Offset: 0x10
This register controls whether the interrupt condition in the Comparator controller is enabled.
Bit
Name
Description
Attribute
Reset
31:1
Reserved
R
0
0
CMPGIE
Comparator edge trigger interrupt enable. (Comparator interrupt trigger
direction refer to CMPG)
0: Disable
1: Enable
R/W
0