2024-07-09 10:55 PM
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;
}