2022-02-21 09:32 AM
My fellow student says TIM12 has 2 channels and PH9 is configured for TIM12 channel 2 as per the below datasheet.
https://www.st.com/resource/en/datasheet/stm32h743vi.pdf
Now I argue that the tim12 channel 2 is configured to PB15.And he stupidly configured this way.
"""
GPIO_InitStruct.gpio_port = GPIOH;
GPIO_InitStruct.configure.Pin = GPIO_PIN_9;
GPIO_InitStruct.configure.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.configure.Pull = GPIO_NOPULL;
GPIO_InitStruct.configure.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.configure.Alternate = GPIO_AF2_TIM12;
"""
Who is right and who is wrong? is PH9 (my friends) or PB15 correct?
Solved! Go to Solution.
2022-02-25 02:02 AM
Hello @Vmere.1 ,
Thanks for your feedback,
As @MM..1 and @TDK mentioned, both pins support TIM12_CH2 signal. So using PH9 or PB15 for TIM2_CH2 is correct.
In CubeMX, the default pin that is set to TIM12_CH2 is PB15 but it is possible to change it to PH9. Please check this article on How to remap an alternate function from one GPIO to another using STM32CubeMX
Saying that PB15 is reserved for another signal, in this case CubeMX will automatically use PH9.
I hope this helps !
If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)
Sara.
2022-02-21 09:39 AM
Signal on pinout have more alternative, here two both right, need reconfig on wizard how you need.
2022-02-21 11:27 AM
The datasheet shows that both PB15 and PH9 are able to be connected to TIM12_CH2.
Nobody is wrong, except perhaps you for calling his working code stupid, but that's more opinion than fact.
2022-02-25 02:02 AM
Hello @Vmere.1 ,
Thanks for your feedback,
As @MM..1 and @TDK mentioned, both pins support TIM12_CH2 signal. So using PH9 or PB15 for TIM2_CH2 is correct.
In CubeMX, the default pin that is set to TIM12_CH2 is PB15 but it is possible to change it to PH9. Please check this article on How to remap an alternate function from one GPIO to another using STM32CubeMX
Saying that PB15 is reserved for another signal, in this case CubeMX will automatically use PH9.
I hope this helps !
If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)
Sara.