Other Parts Discussed in Thread: HALCOGEN
Hi Team,
The program calls the RTI for timing, the timer is set to 100ms, then the flag bit is set in the interrupt function, and the flag bit is detected in the background while loop. If the condition is true, send one CAN data out. The time has increased significantly after 5 to 6 can frames.
RTI configuration is as follows:
The interrupt functions are as follows:
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 */ }
The background functions are as follows:
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 */ }
The data received through the CAN receive tool is as follow, the time stamp in the red box has a significant increase, around 20ms:
Could you help check this case? Thanks.
Best Regards,
Cherry