This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C6416T的TIMER中断函数无法进入



TIMER的测试程序及中断函数的代码如下,DSP的NMI管脚通过一个1K的电阻接地,单步调试程序可以进入中断函数,运行几次就停止啦;点击RUN运行就不能进入,一直在FOR循环中,运行一段时间就停止啦。TIMER的CNT在配置后不为0,CTL和PRD都是对的,还有哪里没有注意到,还是程序里有问题吗?谢谢!

static TIMER_Config myTimConfig =
{
 0x281,
 0x22500000,
 0x0,
};
extern far void vectors();

void main(void)
{
 CSL_init();
 
 hTimer0 = TIMER_open(TIMER_DEV0, TIMER_OPEN_RESET);
 TimerEventId0 = TIMER_getEventId(hTimer0);
  IRQ_setVecs(vectors);
 IRQ_nmiEnable();
 IRQ_map(TimerEventId0,13);
 IRQ_reset(TimerEventId0);
 TIMER_config(hTimer0, &myTimConfig);
 IRQ_enable(TimerEventId0);

 TIMER_start(hTimer0);
 IRQ_globalEnable();

for(;;)
 {
  adder++;
  printf("\n dd is %d \n",adder);
 }
}

interrupt void c_int13(void)   
{
 adder1++;
 printf("\n test is %d \n",adder1);
}