2025-05-14 1:41 AM
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:
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.
Solved! Go to Solution.
2025-05-14 2:11 AM
Hello,
There are 2 TIM functions on the same pin - there depends only from software how this can be used.
More details:
Regards
Igor
2025-05-14 2:01 AM
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.
2025-05-14 2:11 AM
Hello,
There are 2 TIM functions on the same pin - there depends only from software how this can be used.
More details:
Regards
Igor
2025-05-14 2:25 AM
I tried that, but couldn't conclude anything.
2025-05-14 2:27 AM
Thank you. Reading now, and trying to comprehend...
2025-05-14 3:04 AM
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?
2025-05-14 3:46 AM
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.