Hi, I tried to pause both interrupts from each other using method you mentioned above. But It didn't
work for me. (I have enabled Nested Interrupt)
When I write "INTC.CPR.R = 0" at the beginning of each interrupt, my program stops working. (Interrupt doesn't get triggered)
for that matter, If I write any value less than psrPriority (4 for 1st Interrupt) and (2 for 2nd interrupt), Interrupt doesn't trigger.
To make it work we need to write "INTC.CPR.R equal to or greater than psrPriority", But in that case these interrupts are not able to pause each other.
I am only able to pause 2nd interrupt (psrPriority=2) and trigger 1st interrupt (psrPriority=4).
Please Help me through this.
/**************************************************************************************************************************/
main()
{
InitHW();
Init_eMIOS();
Init_ADC();
Switch_PWM_DutyCycle(INITIAL_A_VAL);
Init_EIRQ();
INTC_InstallINTCInterruptHandler(SIUL_Ext_Int_isr0_7,41,4); /*vector41 for EIRQ0-7 */ //psrPriority = 4
INTC_InstallINTCInterruptHandler(SIUL_Ext_Int_isr8_15,42,2); /*vector42 for EIRQ8-15 */ //psrPriority = 2
INTC.CPR.R = 0; /* Lower current INTC's priority to start ext.interrupts */
while(1)
{
}
}
void SIUL_Ext_Int_isr0_7(void)
{
INTC.CPR.R = 0;
if(SIU.ISR.B.EIF5 == 1) // Ext. Interrupt @ PC[2] //Phase-A BEMF
{
if(SIU.GPDI[34].B.PDI == 1) //To check Rising Edge //Phase-A BEMF (R.E.) //300Degree
{
LED1_ON; //Operations to perform on Rising Edge Interrupt
}
else if(SIU.GPDI[34].B.PDI == 0) //To check Falling Edge //Phase-A BEMF (F.E.) //120Degree
{
LED1_OFF; //Operations to perform on Falling Edge Interrupt
}
}
else
{
}
SIU.ISR.B.EIF5 = 1; /* Clear interrupt flag */
}
void SIUL_Ext_Int_isr8_15(void)
{
INTC.CPR.R = 0;
if(SIU.ISR.B.EIF8 == 1) // Ext. Interrupt @ PC[14] //Current Loop Interrupt
{
if(SIU.GPDI[46].B.PDI == 1) //To check Rising Edge //(R.E.)
{
LED4_ON; //Operations to perform on Rising Edge Interrupt
}
else if(SIU.GPDI[46].B.PDI == 0) //To check Falling Edge //(F.E.)
{
LED4_OFF; //Operations to perform on Falling Edge Interrupt
}
}
else
{
}
SIU.ISR.B.EIF8 = 1; /* Clear interrupt flag */
}
/**************************************************************************************************************************/