Skip to main content
Visitor II
April 25, 2024
Question

STM32f071RB PA1 Comparator

  • April 25, 2024
  • 2 replies
  • 755 views

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!

    This topic has been closed for replies.

    2 replies

    ST Employee
    April 26, 2024

    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

    Super User
    April 29, 2024

    > 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:

    waclawekjan_0-1714423212097.png

    (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.