Hi,
I have configured below 4 external interrupts irq1, irq2, irq3, irq4
Below is the cofiguration
void EIRQ_Init(void)
{
SIU.PCR[451].B.PA=0;
SIU.PCR[451].B.IBE =1;
SIU.PCR[452].B.PA =0;
SIU.PCR[452].B.IBE =1;
SIU.PCR[453].B.PA =0;
SIU.PCR[453].B.IBE =1;
SIU.PCR[454].B.PA =0;
SIU.PCR[454].B.IBE =1;
SIU.IMUX3.B.MUXSEL1= 1; //Selects input from "ETPUC10_IRQ1_SENT5_B_GPIO451" pad (PCR: 451).
SIU.IMUX3.B.MUXSEL2= 1; //Selects input from "ETPUC11_IRQ2_GPIO452" pad (PCR: 452).
SIU.IMUX3.B.MUXSEL3= 1; //Selects input from "ETPUC12_IRQ3_MCANTX1_GPIO453" pad (PCR: 453).
SIU.IMUX3.B.MUXSEL4= 1; //Selects input from "ETPUC13_IRQ4_SDOUT0_PSI5A_RCH0_C_GPIO454" pad (PCR: 454).
//SIU_DIRSR selects between DMA and interrupt requests for events on the IRQ[0]-IRQ[3]
SIU.DIRSR.R =0;
//SIU_EIISR selects the source for the external interrupt
SIU.EIISR.B.ESEL1 =0;
SIU.EIISR.B.ESEL2 =0;
SIU.EIISR.B.ESEL3 =0;
SIU.EIISR.B.ESEL4 =0;
// SIU_DIRER enables external signals on selected pins to generate interrupt
SIU.DIRER.B.EIRE1 =1;
SIU.DIRER.B.EIRE2 =1;
SIU.DIRER.B.EIRE3 =1;
SIU.DIRER.B.EIRE4 =1;
//The SIU_IFEER enables falling edge-triggered events on IRQ[n].
//The SIU_IREER enables rising edge-triggered events on IRQ[n].
//SIU.IFEER.B.IFEEN1 = 1;
SIU.IREER.B.IREE1 = 1;
SIU.IFEER.B.IFEEN2 = 0;
SIU.IREER.B.IREE2 = 1;
SIU.IFEER.B.IFEEN3 = 0;
SIU.IREER.B.IREE3 = 1;
SIU.IFEER.B.IFEEN4 = 0;
SIU.IREER.B.IREE4 = 1;
INTC.PSR[47].R = PRC_SEL_CPU0 | PRC_PRI(10);
}
void ext_isr()
{
int i=0;
if(SIU.EISR.B.EIF1 == 1)
{
for(i=0;i<3;i++){
Read_SPI_error(0x1a,0,1);
SIU.EISR.B.EIF1 = 0x1;
}
}
if(SIU.EISR.B.EIF2 == 1)
{
Read_SPI_error(0x1b,0,1);
SIU.EISR.B.EIF2 = 1;
}
if(SIU.EISR.B.EIF3 == 1)
{
Read_SPI_error(0x1c,0,1);
SIU.EISR.B.EIF3 = 1;
}
if(SIU.EISR.B.EIF4 == 1)
{
Read_SPI_error(0x1d,0,1);
SIU.EISR.B.EIF4 = 1;
}
}
External interrupt is not getting triggeres, here is the vector file declaration
(uint32_t) &ext_isr, /* Vector # 47 SIU_EIISR[EIF1] SIU SIU External Interrupt Flag 1 */
(uint32_t) &ext_isr, /* Vector # 48 SIU_EIISR[EIF2] SIU SIU External Interrupt Flag 2 */
(uint32_t) &ext_isr, /* Vector # 49 SIU_EIISR[EIF3] SIU SIU External Interrupt Flag 3 */
(uint32_t) &ext_isr, /* Vector # 50 SIU_EIISR[EIF15:EIF4] SIU SIU External Interrupt Flags 15-4 */
Please suggest
Thanks
Vrushali
I have tried it and it works fine on my side, see following example code:
ThanksDavid,
I used reference for coding ext interrupt.
However I observe SIU.GPDI[451].B.PDIn is set to 1, however interrupt is still not generated.
Also another observation is SIU_IFIR.B.IF1 =1
I haven't set anything in SIU.IDFR register
Regards
Vrushali
You have incorrectly setup PCR[PA] field.