794
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
10.
Enable COMPx_FILC.FILEN filter
11.
Enable COMPx_CTRL.EN on the comparator
Note: For the above steps, the filter should be enabled first and then the comparator should be enabled. The
comparator should be enabled after the filtering (if enabled) is configured and enabled. In addition, when the
comparator control register is locked, the LOCK can be cancelled only through reset.
COMP working mode
26.4.1
Window mode
The comparators can be combined into 3 window comparators as follows:
Comparator 1 and comparator 2 share PA1 to form window comparators.
Comparator 3 and comparator 4 share PB14 or PB0 to form window comparators.
Comparator 5 and comparator 6 share PC3 or PC4 to form window comparators.
26.4.2
Independent comparator
The seven comparators can be configured independently to complete the comparator function. The output of a
comparator can be output to an I/O port. Each comparator has a different remapped port. You can configure the
comparator register COMPx_CTRL. OUTTRG[3:0] to enable the corresponding feature pin at the output.
Comparator output, support trigger events, such as can be configured as timer 1, timer 8 brake function.
Note: Refer to the comparator interconnection for specific configuration
Comparator interconnection
For the interconnection of the output port of the comparator, please refer to the AFIO register chapter, which defines
the value of the remapping of the comparator OUT.
OUT
COMP1[1:0]
COMP2[3:2]
COMP3[5:4]
COMP[7:6]
COMP5[9:8] COMP6[11:10] COMP7[12]
00
PA0
PA6
PB10
PC5
PB0
PC9
PC2
01
PB1
PA7
PC10
PB12
PB11
PA12
PD12
10
PA11
PA12
Not Used
Not Used
PB6
Not Used
--
11
PB8
PB9
PA2
PC11
PA11
PB7
--
Note:
1. COMP7 has only 1 bit to control output remapping.
2. After COMP1, COMP2, COMP5, and COMP7 are enabled, the IO ports corresponding to COMP1_OUT,
COMP2_OUT, COMP5_OUT, and COMP7_OUT cannot be configured as the output mode of other peripherals,
but can be the input mode of other peripherals, GPIO input, GPIO output.
The comparator INP pin has the following configuration.