cancel
Showing results for 
Search instead for 
Did you mean: 

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

MM..1
Chief II

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.

14 REPLIES 14
Andrew Neil
Evangelist III

@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

 

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
AScha.3
Chief II

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

 

If you feel a post has answered your question, please click "Accept as Solution".

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 ?


@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

 

 

You see any more "+" here ? Then use it.

Otherwise you select other AF , maybe TIMx , then you have ONLY this AF.

If you feel a post has answered your question, please click "Accept as Solution".

I see , that MX dont do this. I ask is this possible by internal hw architecture ... 


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

Indeed - only one:

AndrewNeil_3-1721987320573.png

AndrewNeil_4-1721987475934.png

 

 


@MM..1 wrote:

 I ask is this possible by internal hw architecture ... 


No: See RM screenshots.

 

tl;dr:

  • Only a maximum of one AF for each pin;
  • Selecting Analogue mode disables all AF.