SN32F280 Series
32-Bit Cortex-M0 Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 105
Version 1.1
8.4.2 CMP Control register 1 (CMP_CTRL1)
Address Offset: 0x04
Bit
Name
Description
Attribute
Reset
31:13
Reserved
R
0
12
CM2G
CMP2 interrupt trigger direction control bit.
0: Falling edge trigger (CMP2 output status is from high to low as V+ < V-)
1: Rising edge trigger (CMP2 output status is from low to high as V+ > V-)
R/W
0
11:10
CM2OEN[1:0]
CMP2 output pin control bit.
00: Disable (CM2O is GPIO mode)
01: P0.12 is CM2O and isolate GPIO function.
10: P0.3 is CM2O and isolate GPIO function.
11: P3.8 is CM2O and isolate GPIO function.
R/W
0
9:5
CM2RS[4:0]
CMP2 internal reference voltage (V
IREF2
) selection bits.
00000: V
IREF2
= V
IREF
00001~11111: V
IREF2
= V
IREF
* CM2RS[4:0] / 32
R/W
00000b
4:3
CM2NS[1:0]
CMP2 negative input pin selection bit
00: CM2N0 is comparator negative input pin, and isolate GPIO function
01: CM2N1 is comparator negative input pin, and isolate GPIO function
10: CM2N2 is comparator negative input pin, and isolate GPIO function
11: V
IREF2
. CM2N0/CM2N1/CM2N2 pins are GPIO mode.
R/W
00b
2:1
CM2PS[1:0]
CMP2 positive input pin selection bit
00: Reserved. CM2P0/CM2P1/CM2P2 pins are GPIO mode.
01: CM2P0 is comparator positive input pin, and isolate GPIO function
10: CM2P1 is comparator positive input pin, and isolate GPIO function
11: CM2P2 is comparator positive input pin, and isolate GPIO function
R/W
01b
0
CM2EN
CMP2 enable bit.
0: Disable (CM2P0/1/2, CM2N0/1/2, CM2O are GPIO mode)
1: Enable
R/W
0
8.4.3 CMP Internal Reference Voltage Source register (CMP_VIREF)
Address Offset: 0x08
Bit
Name
Description
Attribute
Reset
31:3
Reserved
R
0
2:1
CMPIREF[1:0]
Comparator internal reference voltage (V
IREF
) source
00: VDD
01: internal 1.5V
10: internal 2V
11: Internal 3V
R/W
0
0
CMPIREFEN
Comparator internal reference voltage (V
IREF
) enable bit.
0: Disable
1: Enable
R/W
0
8.4.4 CMP Output Status register (CMP_OS)
Address Offset: 0x0C
Note:
CMnOUT is comparator raw output without latch. It varies depend on the comparator process
result. But the CMnIF is latch comparator output result. It must be cleared by program.
Bit
Name
Description
Attribute
Reset