- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
I wonder if everyone has my same problem or has resolve it. I implemented on TC375 a CAN communication - I set the can module on TC375 as a receiver one. My aim is to obtain, for every received message, the timestamp of the message itself.
I thought to associeted, every time the interrupt routine of received message was triggered, a subroutine which use STM0_TIM0 register, but i have some problems, the number obtained it's not easily understandable.
There are other ways to extract time stamp of messages on CAN bus communication for TC375?
A specific library for example or similar?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much!
I make a recap in order to verify i really understand:
I initialize the stucture _Ifx_Can_RxMsg, then I do the same with the interrupt
IfxCan_Node_getDataLengthCode
and in this way i get the time stamp of the arrived message.
I have a question: if i initialize the structure and than every time i call the interrupt of received message i use as and example:
readCanMsg(...);
msgID = rxMsg.messageId;
time_stamp =
(IfxCan_DataLengthCode)rxBufferElement->R1.B.DLC;
Can I do this, right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On start of frame reception / transmission the counter value is captured and stored into the timestamp section
of an Rx Buffer / Rx FIFO (RXTS[15:0]) or Tx Event FIFO (TXTS[15:0]) element.
You can check the RX Buffer for timestamp. Do you have any question on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi!
thank you so much for the answer. So yes, I have some question about:
I initialize Rx Buffer (or Tx Buffer) during the configuration of MCAN, my question is which command can I use to log into Buffers?
I try to explain myself better:
There is a kind of structure in which I can extract an attribute?
or do I need to use more specific command to log into?
thank you so much for patience
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please check below struct for R1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IFX_INLINE uint32 IfxCan_Node_getDataLengthCode(Ifx_CAN_RXMSG *rxBufferElement)
{
return (IfxCan_DataLengthCode)rxBufferElement->R1.B.DLC;
}
Above call is for your reference. You should modify as your request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much!
I make a recap in order to verify i really understand:
I initialize the stucture _Ifx_Can_RxMsg, then I do the same with the interrupt
IfxCan_Node_getDataLengthCode
and in this way i get the time stamp of the arrived message.
I have a question: if i initialize the structure and than every time i call the interrupt of received message i use as and example:
readCanMsg(...);
msgID = rxMsg.messageId;
time_stamp =
(IfxCan_DataLengthCode)rxBufferElement->R1.B.DLC;
Can I do this, right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sara, Yes you can do this, please note that DLC is not timestamp, you should modify the code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh, sorry, how silly!
So maybe I didn't get which available variable the time information was stored?
Referring to my "pseudo code" : time_stamp will be equal to what?
I can't get it
thank you so much for your patience