Comparator (COMP)
RM0365
411/1080
DocID025202 Rev 7
For this purpose, the comparator control and status registers can be write-protected (read-
only).
Once the programming is completed, using bits 30:0 of COMPx_CSR, the COMPxLOCK bit
can be set to 1. This causes the whole COMPx_CSR register to become read-only,
including the COMPxLOCK bit.
The write protection can only be reset by a MCU reset.
17.3.5 Hysteresis
(STM32F302xBxC
only)
The comparator includes a programmable hysteresis to avoid spurious output transitions in
case of noisy signals. The hysteresis can be disabled if it is not needed (for instance when
exiting from low-power mode) to be able to force the hysteresis value using external
components.
17.3.6 Comparator
output blanking function
The purpose of the blanking function is to prevent the current regulation to trip upon short
current spikes at the beginning of the PWM period (typically the recovery current in power
switches anti parallel diodes).It consists of a selection of a blanking window which is a timer
output compare signal. The selection is done by software (refer to the comparator register
description for possible blanking signals). Then, the complementary of the blanking signal is
ANDed with the comparator output to provide the wanted comparator output. See the
example provided in the figure below.
Figure 119. Comparator output blanking
069
&XUUHQWOLPLW
&XUUHQW
5DZFRPSRXWSXW
%ODQNLQJZLQGRZ
)LQDOFRPSRXWSXW
3:0
&RPSRXW
%ODQN
&RPSRXWWR7,0B%.«