Other Parts Discussed in Thread: C2000WARE, MG2
Hi team,
My customer is trying to achieve interrupt nesting and customized priority in their code. Here is some questions we got:
For this topic, we are mainly refer to TI wiki
http://processors.wiki.ti.com/index.php/Interrupt_Nesting_on_C28x
1. According to the C28x interrupt service routine table, when interrupt is served, the HW would disable the interrupt step 1~4. When is the interrupt re-enabled? Is it by S/W or H/W?
2. In the example you give, why a DINT is needed? By 'insert ISR code here', does it mean we directly insert the ISR code in the current ISR, or it is another ISR function? If we directly insert the code here, why this is a nesting?
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;
3. When using EINT, DINT, which register are we operating? Is it INTM?
Thanks,
Brian