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.
在C6657LS EVM上运行Timer样例,样例中Timer的周期设置为1ms,系统工作频率为1GHz,KeyStone_main_PLL_init(100, 10, 1);
在Timer中断服务程序中增加了DSP滴答时戳
void interrupt Timer_ISR(void)
{
uiTick++;
tscl= TSCL;
tsch= TSCH;
printf("\n %d times, Timer_ISR at DSP-CYCLE %lld \n",uiTick, _itoll(tsch, tscl));
}
程序加载到C66xx_0,运行结果如下:
[[C66xx_0] Initialize DSP main clock = 100.00MHz/1x10 = 1000MHz
[C66xx_0] Enable Exception handling...
[C66xx_0]
[C66xx_0] a pulse will be generated on TIMO0...
[C66xx_0]
[C66xx_0] 1 times, Timer_ISR at DSP-CYCLE 2000005837
[C66xx_0] a pulse was generated on TIMO0
[C66xx_0]
[C66xx_0] clocks will be generated on TIMO0...
[C66xx_0]
[C66xx_0] 1 times, Timer_ISR at DSP-CYCLE 2000519445
[C66xx_0]
[C66xx_0] 2 times, Timer_ISR at DSP-CYCLE 2000529193
[C66xx_0] External exception happened. MEXPFLAG[3]=0x1.
[C66xx_0] Event 96: DSP Interrupt 14 (INTC input Event 64) dropped
[C66xx_0] NRP=0xc0085a6, NTSR=0x1000d, IRP=0xc0085a6, ITSR=0xd, TSCH= 0x0, TSCL= 0x773dcd59
[C66xx_0] B3=0xc008584, A4=0x30, B4= 0x3e8, B14= 0x802128, B15= 0x8011d0
[C66xx_0]
[C66xx_0] 3 times, Timer_ISR at DSP-CYCLE 2000591788
[C66xx_0]
。。。。
[C66xx_0] 1058 times, Timer_ISR at DSP-CYCLE 2011041780
[C66xx_0]
[C66xx_0] 1059 times, Timer_ISR at DSP-CYCLE 2011051789
[C66xx_0]
[C66xx_0] 1060 times, Timer_ISR at DSP-CYCLE 2011061799
[C66xx_0]
[C66xx_0] 1061 times, Timer_ISR at DSP-CYCLE 2011071808
[C66xx_0]
[C66xx_0] 1062 times, Timer_ISR at DSP-CYCLE 2011081817
[C66xx_0]
[C66xx_0] 1063 times, Timer_ISR at DSP-CYCLE 2011091826
在Timer-ISR中前后DSP_Cycle差约为10400,若是1ms对应的DSP-cycle是10400,好像差异很大,DSP-CYCLE时间该怎么计算?
另外,依据Timer例程,
while(uiTick<NUM_CLOCKS_GENERATED*2)
asm(" nop 5");
Reset_Timer(DNUM); //stop the timer
该中断应该运行NUM_CLOCKS_GENERATED(500)*2 = 1000次后终止,改到运行start watch-dog timer...,但是Timer_ISR一直运行下去,是哪出错了吗?
运行结果中的 Event 96: DSP Interrupt 14 (INTC input Event 64) dropped,说明什么问题呢?
将.out加载到C66xx_1核运行,输出如下:
[C66xx_1] 993 times, Timer_ISR at DSP-CYCLE 2496499416
[C66xx_1]
[C66xx_1] 994 times, Timer_ISR at DSP-CYCLE 2496999392
[C66xx_1]
[C66xx_1] 995 times, Timer_ISR at DSP-CYCLE 2497499374
[C66xx_1]
[C66xx_1] 996 times, Timer_ISR at DSP-CYCLE 2497999348
[C66xx_1]
[C66xx_1] 997 times, Timer_ISR at DSP-CYCLE 2498499336
[C66xx_1]
[C66xx_1] 998 times, Timer_ISR at DSP-CYCLE 2498999312
[C66xx_1]
[C66xx_1] 999 times, Timer_ISR at DSP-CYCLE 2499499299
[C66xx_1]
[C66xx_1] 1000 times, Timer_ISR at DSP-CYCLE 2499999283
[C66xx_1] clocks were generated on TIMO0
[C66xx_1]
[C66xx_1] start watch-dog timer...
[C66xx_1] service watch-dog 1 times, at time counter = 6
[C66xx_1] service watch-dog 2 times, at time counter = 1678
[C66xx_1] service watch-dog 3 times, at time counter = 1723
[C66xx_1] service watch-dog 4 times, at time counter = 1723
[C66xx_1] service watch-dog 5 times, at time counter = 1724
[C66xx_1] service watch-dog 6 times, at time counter = 1723
在Timer-ISR中前后DSP_Cycle差约为500000,这能表示Timer的周期为1ms吗?以上测试数据,请大侠帮忙分析问题出在哪,非常感谢!