Comparator (COMP)
RM0365
413/1080
DocID025202 Rev 7
17.5 COMP
registers
17.5.1
COMP1 control and status register (COMP1_CSR)
Note:
This register is available in STM32F302xB/C/D/E only
Address offset: 0x1C
Reset value: 0x0000 0000
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
COMP1
LOCK
COMP1
OUT
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res.
Res.
COMP1_
BLANKING
COMP1HYST
[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
COMP1
POL
Res.
COMP1OUTSEL
Res.
Res.
Res.
COMP1INMSEL[2:0]
COMP1MODE
[1:0]
COMP
1_INP_
DAC
COMP
1EN
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
1. Only in STM32F302xB/C.
Bit 31
COMP1LOCK
: Comparator 1 lock
This bit is write-once. It is set by software. It can only be cleared by a system reset.
It allows to have COMP1_CSR register as read-only.
0: COMP1_CSR is read-write.
1: COMP1_CSR is read-only.
Bit 30
COMP1OUT
: Comparator 1 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
COMP1_BLANKING
: Comparator 1 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
COMP1HYST[1:0]
Comparator 1 hysteresis
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.
Bit 15
COMP1POL
: Comparator 1 output polarity
This bit is used to invert the comparator 1 output.
0: Output is not inverted
1: Output is inverted