Hello Team,
I am using MPC5604 for some prototype, and have two input pin the read the data.
How to configure interrupt on those pins - two pin in Port C are used to read the data.
please share some code on the same.
Thanks
It is needed to configure SIU and interrupt controller:
SIU.PCR[3].R = 0x0103; // Pin PA[3]-EIRQ0 configured as GPIO, input, pull up enable
SIU.IFEER.B.IFEE0 = 1; // Enable falling edge event on EIRQ0
SIU.IRER.B.IRE0 = 1; // Enable interrupt EIRQ0
INTC_InstallINTCInterruptHandler(SIUL_Ext_Int_isr,41,1); // vector41 for EIRQ0
INTC.CPR.R = 0; // Lower current INTC's priority to start ext.interrupts
During ISR then it is needed to test source of EIRQ like this:
static void SIUL_Ext_Int_isr(void)
{
if(SIU.ISR.B.EIF0 == 1)
{
/* ... */
}
else
{
/* ... */
}
}