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.

TMS570LS3137: 使用RTI,发现计时有延迟

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

程序调用RTI用来计时,定时器设置为100ms,然后在中断函数中置标记位,在后台while循环检测标记位,如果条件为真,则向外发送一条CAN数据,发现间隔5~6个can帧后,时间有明显的增加。

RTI配置如下:

中断函数如下:

INT8U	GL_SEND_FLAG = CODFALSE;
void rtiNotification(uint32 notification)
{
/*  enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (9) */
	GL_SEND_FLAG = CODTURE;
/* USER CODE END */
}

后台函数如下:

int main(void)
{
/* USER CODE BEGIN (3) */
    canInit();
    
	rtiInit();
	
	rtiEnableNotification(rtiNOTIFICATION_COMPARE0);
	
	rtiStartCounter(rtiCOUNTER_BLOCK0);

	vimInit();

	while(1)        /* continious desplay        */
   {
		if(CODTURE == GL_SEND_FLAG){
			GL_SEND_FLAG = CODFALSE;
			for(int i = 0; i < 8;++i)
				rx_data[i] = i*0x05;
			canTransmitWithDLC(canREG1, canMESSAGE_BOX1, rx_data,8);
		}
   };
/* USER CODE END */
}

通过CAN接收工具接收数据如下:

图中红线圈起来的地方时间戳有明显的增加,在20ms左右。请帮忙确认下,是有什么配置不正确么