Part Number: TMS320F28379D
Hi,
I have a working closed loop vector control code using the new functions approach header files. I am using EPWM1 INT to compute the control code and EPWM6 INT to update-settings.
I want to implement interrupt nesting where EPWM1 INT could be called whille EPWM6 INT is ongoing.
I am looking the sample exmaples which mainly used the register based approach but I am having difficulty accessing the PieCtrlRegs. I get error of PieCtrlRegs not define as expected. I couldnt find it address to use directly without any header files and adding the register based header files causes a lot of errors.
What is the best way to implement this? (looking to solve errors related to undefine PieCtrlRegs)
Sample code: (any suggestions or potential issues are welcome)
__interrupt void epwm6ISR(void)
{
//added extra code for interrupt nesting
uint16_t TempPIEIER;
TempPIEIER=PieCtrlRegs.PIEIER3.all; //ERROR
IER |= 0x003; // Set global priority by adjusting IER
IER &= 0x003;
PieCtrlRegs.PIEIER3.all &= 0x0001; //ERROR// Set group priority by adjusting PIEIER3 to allow INT3.1 to interrupt current ISR
PieCtrlRegs.PIEACK.all = 0xFFFF; //ERROR// Enable PIE interrupts
asm(" NOP"); // Wait one cycle
EINT;
//added extra code for interrupt nesting
GPIO_writePin(22,1); // GPIO pin to check code computation time
//UPDATE OF SETTINGS AND PARAMETERS |||| MOVE TO SLOWER FUNCTIONS LATER
update_allsettings(); //update filter settings
//
// Clear INT flag for this timer
//
EPWM_clearEventTriggerInterruptFlag(EPWM6_BASE);
//
// Acknowledge interrupt group
//
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP3);
//DEVICE_DELAY_US(5);
GPIO_writePin(22,0); // GPIO pin to check code computation time
//GPIO_togglePin(24); //gpio 24 PIN 34
//GPIO_togglePin(16); //gpio 16 PIN 33
//added extra code for interrupt nesting
//added extra code for interrupt nesting
DINT;
PieCtrlRegs.PIEIER2.all = TempPIEIER; //ERROR
added extra code for interrupt nesting
}
