Interrupt on MPC55xx/56xx

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

Interrupt on MPC55xx/56xx

Jump to solution
1,536 Views
Tatay
Contributor II

Hi everybody,

 

I try to generate interrupt from the PIT, channel 0. I use INTC_InstallINTCInterruptHandler(compteurISR,59,1)​; where compteurISR is my subroutine and 59 is the IRQ number for PIT, channel0. The subroutine is never executed but why? I set the bit that enables interrupts from PIT, and when the counter has finished, the bit PIT.CH[0].TFLG.B.TIF is correctly set.

I also add the function enableIrq that sometimes causes a reset.

 

void enableIrq(void) {
 INTC.CPR_PRC0.B.PRI = 0;/* Lower INTC PRC0's current priority */
  asm(" wrteei 1");       /* and make sure external interrupts are enabled */  
}

 

void Setup_Timer()
{  
 PIT.PITMCR.R &=0xFFFFFFFC; //periph actif
    PIT.CH[0].LDVAL.B.TSV=0x005AF07F;//load value
    PIT.TCTRL0.B.TIE=1;//enable interrupt
}

 

int main(void) {
  volatile int i = 0;
  int debut=1;
   
  InitHW();

  Setup_Timer();
  INTC_InstallINTCInterruptHandler(compteurISR,59,1)​;
  enableIrq();
  PIT.TCTRL0.B.TEN=1;

  for (; :smileywink:  {
    i++;

  }

}

 

void compteurISR(void)
{
      //INTC.SSCIR[4].R = 2;
     SIU.GPDO52.B.PDO=~SIU.GPDO52.B.PDO;
     PIT.CH[0].TFLG.B.TIF=1;

}

0 Kudos
Reply
1 Solution
651 Views
Tatay
Contributor II

It is a bug coming from Code Warrior v2.7. it lacks the initialization of IVOR_TABLE in interrupts_p0.c

View solution in original post

0 Kudos
Reply
1 Reply
652 Views
Tatay
Contributor II

It is a bug coming from Code Warrior v2.7. it lacks the initialization of IVOR_TABLE in interrupts_p0.c

0 Kudos
Reply