Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
401
/
631
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
Window mode
Comparator 1 and comparator 2 share PA1 to form window comparators.
Independent comparator
The two 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 chapter on the multiplexing function
of GPIO, which defines the value of the remapping of the comparator OUT.
The comparator INP pin has the following configuration.
INPSEL
COMP1
COMP2
0xxx
Float
Float
1000
PA0
PA1/DAC1/PA4
1001
PA1/DAC1
PA3
1010
PA2
PA6
1011
PA12
PA7
1100
PB3
PA11
1101
PB4
PA15
1110
PB10
PB7
1111
PD5
PD7
Note 1: In window mode, COMP2 automatically selects PA1
Note 2: The selection of the comparator's PA1/DAC1 is done by configuring COMP1_CTRL.INPDAC
The comparator INM pins have the following configuration.