Skip to main content
Visitor II
July 10, 2024
Question

change of dead band issue in PWM

  • July 10, 2024
  • 1 reply
  • 650 views

Hi,

i was trying to change dead time from (244 value to 100) for every 10ms in a loop. But its not updating , the set dead time is 244 in the PWM waveform. 

Though my dead band register ( DTG) is updating  at every 10ms. 

I am updating TIM1->DTR2 

 

if(end_tick_ms <= uwTick)

{

if(no_of_times <4)

{

 

no_of_times += 1;

 

current_tick_ms = uwTick;

end_tick_ms = current_tick_ms + 10;

 

TIM1->DTR2 = i;

 

i *=0.8f;

if(no_of_times == 4)

{

db_adjust = 1;

}

}

 

if(db_adjust == 1)

{

db_adjust = 0;

/***set new dead band value for 2.4usec*******/

TIM1->DTR2 = 100;

}

    This topic has been closed for replies.

    1 reply

    ST Employee
    November 28, 2024

    Hello @Sushmita, you probably solved this issue and got ahead in your project, could you share with us what was the issue? 

    I would say that it was mandatory to enable the deadtime preload bit in TIMx_DTR2 register to enable the deadtime value preload?