MPC5604: Interrupt on port

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5604: Interrupt on port

715 Views
jagadeeshalaksh
Contributor II

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

Labels (1)
0 Kudos
1 Reply

477 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

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

    {

        /* ... */

    }

}

0 Kudos