cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G031 PWM output raising and falling time problem

YChen.9
Associate II

Hi,

I am using the PWM1 mode of the STM32G031 TIM1 and I noticed that the rising and falling edge time of its PWM output is about 20 ns. I have used the PWM fast mode but this time is not getting shorter. I would like to know if this time is normal? Because if I use the GPIO output mode to flip the output directly, this time can be as fast as 10ns

Thanks.

 

1 REPLY 1
MasterT
Lead

Try:

/**TIM2 GPIO Configuration
*/
GPIO_InitStruct.Pin = GPIO_PIN_5;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;  <<<<---------
GPIO_InitStruct.Alternate = GPIO_AF2_TIM2;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);