AnsweredAssumed Answered

Problem with interrupts in MPC5643L (Leopard)

Question asked by Paco Quin on Apr 29, 2011
Latest reply on Jun 21, 2011 by Thomas Foucault

Hi everyone:

 

I'm a newbie with Leopard and I'm trying to generate an interrupt with a falling edge of an external signal. This is the code I have:

 

void initINTC(void){ INTC.BCR.B.HVEN_PRC0=0; //0:SW vector mode, 1: HW vector mode (processor 0) INTC.CPR.B.PRI=0;// Lower INTC's current priority}void initPin(void){ SIU.PCR[0].R=0x0100; //configured as input SIU.IFEER.B.IFEE0=1; //Interrupt Falling-Edge Enable for this pin SIU.IRER.B.EIRE0=1; //Interrupt Request Enable }void INTERRUPT_FALLING_EDGE_0(void){ sendRS232Data(0xFF00FF00); SIU.ISR.B.EIF0=1;}int main(void) {  volatile int i = 0;    initModesAndClks();      /* Initialize mode entries */  initPeriClkGen();        /* Initialize peripheral clock generation for LINFlex */  disableWatchdog();       /* Disable watchdog */  initLINFlex_0();         /* Initialize serial port */  initINTC();              /* Initialize Interrupt Controller */  initPin();               /* Initialize interrupt pin */  INTC_InstallINTCInterruptHandler(INTERRUPT_FALLING_EDGE_0,0,1);  /* Loop forever */  for (;;) {    i++;     }}

 

The interrupt is correctly generated because the interrupt flag in the ISR register is set when the falling edge occurs, but the problem is that the interrupt service routine is never executed.

I've used the  INTC_InstallINTCInterruptHandler instruction to activate the routine, but I don't know what else I need to do.

Somebody could help me?

Thanks and regards.

  

Outcomes