
Comparator (COMP)
RM0351
678/1830
DocID024597 Rev 5
For this purpose, the comparator control and status registers can be write-protected (read-
only).
Once the programming is completed, the COMPxLOCK bit can be set to 1. This causes the
whole register to become read-only, including the COMPxLOCK bit.
The write protection can only be reset by a MCU reset.
22.3.5 Window
comparator
The purpose of window comparator is to monitor the analog voltage if it is within specified
voltage range defined by lower and upper threshold.
Two embedded comparators can be utilized to create window comparator. The monitored
analog voltage is connected to the non-inverting (plus) inputs of comparators connected
together and the upper and lower threshold voltages are connected to the inverting (minus)
inputs of the comparators. Two non-inverting inputs can be connected internally together by
enabling WINMODE bit to save one IO for other purpose.
Figure 156. Window mode
22.3.6 Hysteresis
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.
069
&203\B,10,2V
&203\B,13,2V
,QWHUQDOVRXUFHV
&203\B,13
&203\B,10
&203\B,106(/
&203\
:,102'(
&203[B,10,2V
&203[B,13,2V
,QWHUQDOVRXUFHV
&203[B,13
&203[B,10
&203[B,136(/
&203[B,106(/
&203[
&203[B,136(/