Interrupt on MPC55xx/56xx

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Interrupt on MPC55xx/56xx

跳至解决方案
1,519 次查看
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 项奖励
回复
1 解答
634 次查看
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 项奖励
回复
1 回复
635 次查看
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 项奖励
回复