Comparator (COMP)
RM0365
415/1080
DocID025202 Rev 7
17.5.2
COMP2 control and status register (COMP2_CSR)
Address offset: 0x20
Reset value: 0x0000 0000
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
COMP
2LOCK
COMP
2OUT
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res.
COMP2_BLANKING[2:0]
COMP2HYST
[1:0]
(1)
rwo
r
rw
rw
rw
rw
rw
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
COMP
2POL
Res.
COMP2OUTSEL[3:0]
COMP2
WIN
MODE
(2)
Res.
COMP2
INPSEL
COMP2INMSEL[2:0]
COMP2MODE
[1:0]
COMP2
_INP_D
AC
(3)
COMP2
EN
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
1. Only in STM32F302xB/C devices.
2. Not available in STM32F302x6/8/D/E devices.
3. Only in STM32F302x6/8 devices.
Bit 31
COMP2LOCK
: Comparator 2 lock
This bit is write-once. It is set by software. It can only be cleared by a system reset.
It allows to have COMP2_CSR register as read-only.
0: COMP2_CSR is read-write.
1: COMP2_CSR is read-only.
Bit 30
COMP2OUT
: Comparator 2 output
This read-only bit is a copy of comparator 1output state.
0: Output is low (non-inverting input below inverting input).
1: Output is high (non-inverting input above inverting input).
Bits 29:21 Reserved, must be kept at reset value.
Bits 20:18
COMP2_BLANKING[2:0]
: Comparator 2 output blanking source
These bits select which Timer output controls the comparator 1 output blanking.
000: No blanking
001: TIM1 OC5 selected as blanking source
010: TIM2 OC3 selected as blanking source
011: TIM3 OC3 selected as blanking source
Other configurations: reserved
Bits 17:16
COMP2HYST[1:0]:
Comparator 2 Hysteresis
On the STM32F302xB/C, these bits control the hysteresis level.
00: No hysteresis
01: Low hysteresis
10: Medium hysteresis
11: High hysteresis
Please refer to the electrical characteristics for the hysteresis values.
On the STM32F302x6/8, these bits are reserved and must be kept at reset value.
Bit 15
COMP2POL
: Comparator 2 output polarity
This bit is used to invert the comparator 2 output.
0: Output is not inverted
1: Output is inverted
Bit 14 Reserved, must be kept at reset value.