2024-06-22 12:27 AM
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.
2024-06-22 08:37 AM
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);