How to make the SIUL Extern Interrupt work in MPC5744P

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

How to make the SIUL Extern Interrupt work in MPC5744P

1,220 Views
fivenumber
Contributor I

      I configured SIUL Extern Interrupt funtion as like Datasheet descript(chater 16.3.4.1), but the funtion not work. The SIUL Extern Interrupt funtion configuration as follows:

Step 1: Mask interrupts by clearing the EIREn bits in DIRER0, configured as SIUL2.DIRER0.R = 0x00000000;

Step 2: Select the pin polarity by setting the appropriate IREEn bits in IREER0 and the appropriate IFEEn bits in IFEER0 as desired. Configured as SIUL2.IFEER0.R = 0x80000000 and SIUL2.IREER0.R = 0x80000000;

Step 3: Configure the appropriate bits in the MSCR[0:511] register. Configured as SIUL2.MSCR[93].R = 0x00090000 and

            SIUL2.IMCR[204].R = 0x00000001;

Step 4:  Select the request desired between DMA or Interrupt by writing the appropriate DIRSn bits in                                         DIRSR0. Configured as SIUL2.DIRSR0.R = 0x80000000;

 Step 5: Select the desired glitch filter setup for the pins. Configured as SIUL2.IFMCR[31].B.MAXCNT = 5 ,               SIUL2.IFCPR.B.IFCP = 8 and SIUL2.IFER0.R = 0x80000000; 

Step 6: Write to EIFn bits in DISR0 to as desired to clear any flags. Configured as SIUL2.DISR0.R = 0x80000000;

Step 7:  Enable the interrupt pins by setting the appropriate EIREn bits in DIRER0. Configured as 

              SIUL2.DIRER0.R = 0x80000000;

Is there anything else that needs to be configured or my configuration have something wrong?

in the end,paste my initialize source code as follows and give my best wishes to everyone!

void External_Interrupt_3_Init(void)
{
   SIUL2.DIRER0.R = 0x00000000;

   SIUL2.IFEER0.R = 0x80000000;          //enable REQ31 rising-edge triggered event

   SIUL2.IREER0.R = 0x80000000;          //enable REQ31 Falling-Edge triggered Event
   SIUL2.MSCR[93].R = 0x00090000;
   SIUL2.IMCR[204].R = 0x00000001;

   SIUL2.DIRSR0.R = 0x80000000;

   SIUL2.IFMCR[31].B.MAXCNT = 5;

   SIUL2.IFCPR.B.IFCP = 8;
   SIUL2.IFER0.R = 0x80000000;       // enabled Filter

   SIUL2.DISR0.R = 0x80000000;       //clear REQ31 interrupt

   SIUL2.DIRER0.R = 0x80000000;
}

2 Replies

771 Views
yashvardhan
Contributor II

Hey five,

I got this working for software interrupts. Please try the same i hope you would be able to get it work.

This would trigger interrupt based upon Switch press. will switch LED on and OFF

I have edited the below example to achieve it.

https://community.nxp.com/thread/390644

static void GPIO_Init(void)
{
   SIUL2.MSCR[92].R = 0x00090000;  //IBE, Pull-down
   SIUL2.DIRER0.R = 0x40000000;      //enable interrupt
   SIUL2.IREER0.R = 0x40000000;      //rising edge event enabled
   SIUL2.IFER0.R = 0x40000000;         //enable interrupt filter

   SIUL2.IMCR[203].R = 0x00000001;

   SIUL2.MSCR[44].B.OBE = 1;

}

int main(void)
{
    int counter = 0;


    HW_Init();
    INTC_0.PSR[246].R = 0x8005;  //Set priority for SW1 interrupt

    for(;;) {       
           counter++;
    }
    
    return 0;
}

Inside intc_SW_mode_isr_vectors_MPC5744P.c

mark to the function you want to call!!

(uint32_t) &SW1_ISR, /* Vector # 246 SIUL2 External Interrupt_3 SIUL2 */

771 Views
yashvardhan
Contributor II

Hello five,

I am having the same problem, Try to see this example it might help

https://community.nxp.com/docs/DOC-332022

Try setting INTC_0.PSR[246].R = 0x8005; SW priority for the following task16.3.4.3.

I don't know it for sure as I am also try. If you figure it out somehow please let me know.

Regards,

Yash Vardhan

0 Kudos