Part Number: TMS320F28075
Hi, my customer is using F28075 to develop an inverter. The switching frequency is 5kHz, and they will observe PWM missing sometime. It's caused by the inverter state flag bit(unFlagSystemA.bit.bInvst) change.
In main() function, they will set the value of unFlagSystemA.bit.bInvst to 0 or 1, the code is as below. It's the only place that unFlagSystemA.bit.bInvst value is written.
In interrupt, they will disable the PWM when unFlagSystemA.bit.bInvst is 0.
They will observe unFlagSystemA.bit.bInvst changed to 0 in the interrupt which caused PWM missing(disabled), but unFlagSystemA.bit.bInvst is 1 before entering the interrupt.
So they add "DINT" to disable all the interrupt before writing to unFlagSystemA.bit.bInvst and then "EINT" to enable the interrupt. Like this
else if(unFlagModOnOffCtrl.bit.bWakeUpOn==1)
{
DINT;
unFlagSystemA.bit.bInvst=1;
EINT;
}
And then they will not have PWM missing problem.
But it's strange that the flag bit value is changed in the interrupt, what may be the cause and how to avoid such things?
Customer is migrating code from F2808 to F28075, and their code is good at F2808.