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.
Tool/software:
Hello,
The 'canGetData' function created by HALCOGEN sets IF2 to clear the NewDat bit in the message object before the data is read. I believe the hardware loads IF2 with the data in the message object before the NewDat bit is cleared; otherwise, if a new message arrives, the message would be lost or mixed up with a new message. Is that correct?
Another question: Can my program read the message object directly? I mean, can it test the NewDat bit, read the data, and clear the NewDat bit afterward? When should the program use IF1/IF2?"
Best regards,
Marcio
Hi Marcio,
The 'canGetData' function created by HALCOGEN sets IF2 to clear the NewDat bit in the message object before the data is read. I believe the hardware loads IF2 with the data in the message object before the NewDat bit is cleared; otherwise, if a new message arrives, the message would be lost or mixed up with a new message. Is that correct?
Message mix-up might not happen once the core starts reading CAN message object, because the core operating frequency very high compared to the CAN baudrate.
The max CAN baudrate is upto 1Mbps only whereas the core frequency can be upto 330Mhz, so once the core starts reading the CAN message object there is no chance to mix up the message.
Another question: Can my program read the message object directly? I mean, can it test the NewDat bit, read the data, and clear the NewDat bit afterward? When should the program use IF1/IF2?"
You can do that,
Can you please refer below threads to understand how IF1 and IF2 are using by driver:
--
Thanks & regards,
Jagadish.