Hello,
According to https://software-dl.ti.com/C2000/docs/c28x_interrupt_nesting/html/index.html the structure of a nested interrupts is as following:
void EPWM1_TZINT_ISR(void) { uint16_t TempPIEIER; TempPIEIER = PieCtrlRegs.PIEIER2.all; // Save PIEIER register for later IER |= 0x002; // Set global priority by adjusting IER IER &= 0x002; PieCtrlRegs.PIEIER2.all &= 0x0002; // Set group priority by adjusting PIEIER2 to allow INT2.2 to interrupt current ISR PieCtrlRegs.PIEACK.all = 0xFFFF; // Enable PIE interrupts asm(" NOP"); // Wait one cycle EINT; // Clear INTM to enable interrupts // // Insert ISR Code here....... // for now just insert a delay // for(i = 1; i <= 10; i++) {} // // Restore registers saved: // DINT; PieCtrlRegs.PIEIER2.all = TempPIEIER; }
Assume, I do not want to change the group-priority at the end of the ISR, is the "DINT" still mandetory?
So is the DINT necessary only to protect the writes of important registers within the isr sourc code like PIEIER, PIEACK, etc...
or is it always required in order to protect the last three automatic software steps when
an ISR is finished:
1. Manual context restore (if needed)
2. Execute the NASP instruction
3. Execute IRET instruction
Best regards
wilson