Skip to main content
JZhan.33
Associate
March 2, 2023
Question

STM32L072RBT6 - Define PC9 as AF2 for analog output

  • March 2, 2023
  • 5 replies
  • 2174 views

Hi,

I am trying to Define PC9 as AF2 for analog output.

0693W00000aI3hNQAS.png

After defining, the output keeps high. How can I define it as "TIM3_CH4" not" USB_NOE"?

It could be the reason getting HIGH.

Thanks!

Jason

This topic has been closed for replies.

5 replies

waclawek.jan
Super User
March 2, 2023
  1. What do you mean by "analog output"? PC9 has no analog function.
  2. Pins marked ***/*** usually have both functionalities simply connected together, so you cannot use both peripherals at the same time when using these pins. In other words, if you have USB enabled, you are probably unable to use that pin for TIM3, and vice versa.

[EDIT]

0693W00000aI40jQAC.png 

JW

waclawek.jan
Super User
March 2, 2023

Hi @Imen DAHMEN​ ,

this is IMO a surprising feature - two peripherals controlling a single pin - and maybe even more surprising is that it is multiplexed in TIM module.

I would suggest a footnote to both the Pin definitions and Alternate functions tables, in all related datasheets.

[EDIT] It also appears, that PC9 has this "dual" function only in 'L07x, so this IMO deserves also a mention, this time in the TIM3_OR bit 4 description, in the two relevant Reference Manuals.

Can you please look at this. Thanks.

JW

ST Technical Moderator
March 3, 2023

Hi @Community member​ ,

Thank you for rising this up. I will take the necessary action.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
waclawek.jan
Super User
March 3, 2023

Thanks, Imen.

Jan

@Imen DAHMEN​ 

JZhan.33
JZhan.33Author
Associate
March 2, 2023

This is correct path. It is fixed.

Thanks!

Jason