Part Number: TMS320F28069F
Something really weird happens while trying to set DCBEVT1, which seems like forgetting EALLOW, but is not. This is the code:
Uint16 st1 = GetST1();
Uint16 WriteIsAllowed = IsRegWriteAllowed();
DEBUG_ASSERT(WriteIsAllowed);
BridgePwmRegsPtr[Phase]->TZEINT.bit.DCBEVT1 = 0;
DEBUG_ASSERT(BridgePwmRegsPtr[Phase]->TZEINT.bit.DCBEVT1 == 0);
Sporadically, DCBEVT1 fails to change to 1 for some reason. With the other code, I am checking if the EALLOW bit in ST1 is set, ie. write protection is disabled (which it is consistently). I also check the EALLOW bit in the debugger when it breaks at the DEBUG_ASSERT. I am at a loss, does anyone know what I am doing wrong here or what kind of H/W or compiler bug could be causing this?