Skip to main content
Vmere.1
Associate III
February 21, 2022
Solved

Is there mistake in datasheet?

  • February 21, 2022
  • 3 replies
  • 1441 views

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.0693W00000KZyjpQAD.pngAnd 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?

This topic has been closed for replies.
Best answer by Sara BEN HADJ YAHYA

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.

3 replies

MM..1
Chief III
February 21, 2022

Signal on pinout have more alternative, here two both right, need reconfig on wizard how you need.

TDK
February 21, 2022

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.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Sara BEN HADJ YAHYA
Technical Moderator
February 25, 2022

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.

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.