Interrupt on MPC55xx/56xx

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Interrupt on MPC55xx/56xx

ソリューションへジャンプ
1,653件の閲覧回数
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 解決策
768件の閲覧回数
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 返信
769件の閲覧回数
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 件の賞賛
返信