Skip to main content
Graduate II
July 25, 2024
Question

How activate one AF and more Analog func on same pin G431

  • July 25, 2024
  • 3 replies
  • 2460 views

Hi i plan new design and require activate for example on PA3 ADC1_IN4 and same time COMP2_INP.

Is this possible and if yes how sequence to setup HAL LL or direct?

EDIT: Renamed from more AF ... only one AF poss.

    This topic has been closed for replies.

    3 replies

    Super User
    July 25, 2024

    @MM..1 wrote:

    Is this possible 


    I think not - you can only select one AF ?

    EDIT:

    The AFSEL takes one value to select one AF - it's not a bitmap:

    AndrewNeil_0-1721927753139.png

     

    Super User
    July 26, 2024

    @Andrew Neil wrote:
    you can only select one AF ?

    Indeed - only one:

    AndrewNeil_3-1721987320573.png

    AndrewNeil_4-1721987475934.png

     

     

    Graduate II
    July 25, 2024

    No

    But check the internal plumbing / connectivity of COMP2_INP, might be some, will be fixed/limited.

    Otherwise use two pins and wire.

    Also does an ADC need an AF setting? It's kind of implied via "Analogue Input" mode for the pin and not the AF mapping

    Super User
    July 25, 2024

    Hi,

    just try to enable both in CubeMx , if possible you can do it ( = if both on analog mux).

    see on F303, the green "+" , can use comp, adc, opamp on same pin:

    AScha3_0-1721931954750.png

    (Probably same on your G431 .)

    And gen.code, just look, how Cube is doing/setting...then you know, how to do.

     

    If need set AF , say TIMx , only one AF can be set in register for AF-function on a pin.

    So impossible to set the AF mux to two different values same time. (need 2 pins then, as Tesla said.)

     

    MM..1Author
    Graduate II
    July 26, 2024

    Perfect G4 have this + too, but what if i need activate same time TIM2CH4 and ADC and COMP (based on 303 showed). Or better say one AF plus some analogs.

    And from your image i mean MX miss EXTI here, because this is too combinable or ?

    Super User
    July 26, 2024

    @MM..1 wrote:

    say one AF plus some analogs.


    Doesn't selecting any analogue disable all AF ?

    EDIT:

    Yes, it does:

    AndrewNeil_0-1721987066418.png

    AndrewNeil_1-1721987114594.png

    AndrewNeil_2-1721987163839.png