How to stop properly Timer PWM generation (CH + CHN) ?
Hello!
I work on 10KHz dual PWM (CH, CHN) generation with dead time implemented.
In error handle I want to stop the timer, and now I do it like this:
if(HAL_TIM_PWM_Stop(&htim8, TIM_CHANNEL_2) != HAL_OK)
{
//Error_Handler();
}
//Stop channel xN
if(HAL_TIMEx_PWMN_Stop(&htim8, TIM_CHANNEL_2) != HAL_OK)
{
//Error_Handler();
}

----------------------------------------------------------

----------------------------------------------------------
(duty cycle 50%)
The first osci picture looks like its a good stop, but the second osci picture is totally bad.
The thing, if I use the firt cube picture config, and change the time when I execute the STOP function, it create a peak on Negative channel.
The main problem is when the N channel output is high, when it doesn't need to be.
I does'nt really understand, why it switch pin to HIGH at the moment of STOP.
So my question is, how to stop properly the timer?
Do I miss some other configuration in CubeMX?
I have tried to change PWM mode 1, 2 and changing the idle state but it doesn't help.
Thank you,
Szilveszter
