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.

6678中计算进入一个任务的周期



在6678(主频1GHz运行)中使用SYS/BIOS系统,建立了一个任务,该任务由HWI(外部0.5毫秒脉冲触发)通过发布信号量执行接下来的程序。

现在希望测量进入任务的周期(单位是cpu cycle)。

使用下面的程序测量该时间DTIME发现会有较大的突变,还有其他方式(TIMER,TIMESTAMP,CLOCK)实现该功能吗?

//初始时t1=t2=_itoll(TSCH,TSCL);

while(1){

.......

//永久等待信号量

t2=_itoll(TSCH,TSCL);

DTIME=t2-t1;

t1=t2;

......

}