cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F030 changing deadtime under operation

Balint C
Associate
Posted on December 11, 2017 at 21:37

Hello Community.

I have a project with PWM output TIM1_CH2 and TIM1_CH2N.

I can set deadtime without problem if I do that at the inicialization and setting the TIM1_BDTR lock_level_1.

But I want to change the deadtime under the oparation between 2 values. I am not sure is it possible or not because I have problem.

When I turn off the LOCK_LEVEL_1 to LOCK_LEVEL_OFF and set once the deadtime value than watching pwm on oscilloscope I can see almost every second or third period the MCU fails to add the deadtime and run the outputs without it. Sometimes it is missing at the rising edge sometimes the falling edge and sometimes both totally randomly happens.

So I want to ask what is the good procedure to do that without failing any period.

1 REPLY 1
Posted on December 12, 2017 at 09:47

Strange. Lock should prevent writing certain register bits, but definitively should not impact the operation itself. Do you write to TIM registers while running the test? Try producing a simple 'static' test - only fill the timer registers and then remain in an infinite loop. If problems still persist, read out and post TIM registers content together with a picture (foto, drawing) showing the problem.

JW