cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G474, dual functionality on PD3, alternate function 2

EThom.3
Senior

I am confused.

On an STM32G474QE, I intend to use PD3 for TIM2_CH1. I'm running out of pins, so this is the only practical pin for me to use.

However, according to the datasheet (DS12288 Rev 6), this pin can be either TIM2_CH1 or TIM2_ETR when alternate function 2 is selected. It is mentioned in the pinout list, as well as the alternate functions table:

EThom3_1-1747210574894.png

EThom3_0-1747210511651.png

This confuses me. As far as I know, these two signals don't rule out each other. There shouldn't be anything preventing the developer from using ETR as a an external trigger or clock source, and at the same time use CH1 for input capture or output compare. Of course, I might be wrong about this.

I haven't found a description of this anywhere else in the datasheet. And not at all in the reference manual and the errata sheet. Nor have I been able to find a bit in the TIM2 registers that selects either CH1 or ETR for this pin.

Does anyone know what this is about? Have I missed something that should be obvious? Is it a typo that has somehow survived through numerous revisions?

Any help regarding this will be highly appreciated.

By the way, I see the exact same thing in the STM32G473 datasheet. No explanation there either.

1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

There are 2 TIM functions on the same pin - there depends only from software how this can be used.

More details:

https://community.st.com/t5/stm32-mcus-products/how-to-use-tim2-etr-and-tim2-ch1-at-the-same-time/td-p/188934

 

  Regards

                        Igor

View solution in original post

6 REPLIES 6
AScha.3
Chief III

Just try to set both in CubeMx on this pin, then you see...

on some pins really 2 functions can work same time, something like  ADC1 input  and ADC2 input on a pin.

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

Hello,

There are 2 TIM functions on the same pin - there depends only from software how this can be used.

More details:

https://community.st.com/t5/stm32-mcus-products/how-to-use-tim2-etr-and-tim2-ch1-at-the-same-time/td-p/188934

 

  Regards

                        Igor

I tried that, but couldn't conclude anything.

Thank you. Reading now, and trying to comprehend...

Let's see if I understand this correctly:

If I use CH1 as a PWM output, and don't use ETR at all, then I should be able to use PD3 as TIM2_CH1, just like any other TIM2_CH1 capable pin. Am I right?

Ah... I can see why CubeMX didn't help me. For some reason, it no longer works as it should.

This is for a different post, though.