2024-04-25 07:09 AM
Hello!
I'm using Comparator 1 in the STM32f071rbt6 uC. The Comp is properly configured, and sends an interrupt once triggered on PA1 referenced to PA4(DAC_OUT_1).
it happened that the PA1 GPIO accidentally was not configured. Yet the comparator functionality still works. Is this somehow possible? As far as I know GPIOs are configured as input float and for the COMP1 it need to be alternative function in order to be connected. Any idea why this works?
Thanks and have a great day!
2024-04-26 09:37 AM
Hello tage
This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.
Kind Regards
Joe WILLIAMS
STMicro Support
2024-04-29 01:50 PM
> As far as I know GPIOs are configured as input float and for the COMP1 it need to be alternative function in order to be connected.
PA1 here is used as COMP1_INP i.e. input. RM requires it to be set as Analog Input:
(COMP *outputs* need to be configured as AF, but that's not the case here.)
However, in 'F0, analog functions such as ADC - and apparently also COMP - which are on TTa pins (as is PA1), are connected directly to given pin. It means, that they work also if the pin is set to GPIO Input; however, their "performance" is influenced by the connected Schmitt trigger input circuit. Setting it to Analog disconnects that circuit.
JW
PS. @Joe WILLIAMS , can you please discuss/correct me here. Thanks.