Comparator (COMP)
RM0365
DocID025202 Rev 7
17 Comparator
(COMP)
17.1 Introduction
STM32F302xB/C/D/E embed four general purpose comparators that can be used either as
standalone devices (all terminal are available on I/Os) or combined with the timers.
STM32F302x6/8 embed three comparators, COMP2, COMP4 and COMP6.
STM32F302xx embed four general purpose comparators COMP1, COMP2, COMP4 and
COMP6 that can be used either as standalone devices (all terminal are available on I/Os) or
combined with the timers.
The comparators can be used for a variety of functions including:
•
Wake-up from low-power mode triggered by an analog signal,
•
Analog signal conditioning,
•
Cycle-by-cycle current control loop when combined with the DAC and a PWM output
from a timer.
17.2 COMP
main
features
•
Rail-to-rail comparators
•
Each comparator has positive and configurable negative inputs used for flexible voltage
selection:
–
Multiplexed I/O pins
–
DAC1 channel 1
–
Internal reference voltage and three submultiple values (1/4, 1/2, 3/4) provided by
scaler (buffered voltage divider)
•
Programmable speed / consumption (only on STM32F302xBxC)
•
Programmable hysteresis (only on STM32F302xBxC)
•
The outputs can be redirected to an I/O or to timer inputs for triggering:
–
Capture events
–
OCREF_CLR events (for cycle-by-cycle current control)
–
Break events for fast PWM shutdowns
•
COMP1 and COMP2 comparators can be combined in a window comparator. This
applies to STM32F302xB/C devices only.
•
Comparator outputs with blanking source
•
Each comparator has interrupt generation capability with wake-up from Sleep and Stop
modes (through the EXTI controller)