Skip to main content
Balint C
Visitor II
December 11, 2017
Question

STM32F030 changing deadtime under operation

  • December 11, 2017
  • 1 reply
  • 903 views
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.

    This topic has been closed for replies.

    1 reply

    waclawek.jan
    Super User
    December 12, 2017
    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