Skip to main content
MM..1
Super User
July 25, 2024
Question

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

  • July 25, 2024
  • 14 replies
  • 2564 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.

14 replies

Andrew Neil
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

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Andrew Neil
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

 

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Tesla DeLorean
Guru
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

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
AScha.3
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.)

 

If you feel a post has answered your question, please click on " Best Answer ".
MM..1
MM..1Author
Super User
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 ?

Andrew Neil
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

 

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.