Skip to main content
This topic has been closed for replies.

3 replies

Houssem CHAABANI
Visitor II
December 30, 2020

Hi @Gz​ ,

You can generate PWM with CH1 for TIM2 by select PWM Generation CH1 under Timers -> TIM2.

0693W000006HA7yQAG.pngHope that this help you!

Gz_it
Gz_itAuthor
Associate III
December 30, 2020

Hi @Houssem CHAABANI​ ;

I found problem. I generate PWM CH1 to compare with PWM CH3.

 PWM Channel 1
 */
 GPIO_InitStruct.Pin = GPIO_PIN_0;
 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
 GPIO_InitStruct.Pull = GPIO_NOPULL;
 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
 
 PWM Channel 3
 */
 GPIO_InitStruct.Pin = GPIO_PIN_1;
 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
 GPIO_InitStruct.Pull = GPIO_NOPULL;
 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
 GPIO_InitStruct.Alternate = GPIO_AF2_TIM2;
 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

The PWM Channel 1 not included " GPIO_InitStruct.Alternate = GPIO_AF2_TIM2;"

Thank you,

Best regards.

Houssem CHAABANI
Visitor II
December 30, 2020

Hi @Gz​ ,

Thank you for your feedback.

This was reported internally and it will be fixed as soon as possible.

In meanwhile you can add the missing configuration manually in your code.

Thanks!