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.

TCAN4550-Q1: RXTS for Time Calculation

Part Number: TCAN4550-Q1

Hi team,

Our customer would like to know how to use RX timestamp(RXTS) to calculate a period of time(LSB: 1us). Could you share the method/calculation if you have any?

Regards,

Muwei Zheng

  • Hi Muwei,

    The Timestamp Counter can be configured to count up in multiple of CAN bit times (determined by the CAN bittime configuration in MCAN). This timer can be used to determine the arrival time of a CAN frames relative to each other. For instance, if the timestamp for CAN frame 2 equals 500, the frame will have started 500 counts before CAN frame 1 that has a timestamp equal to 0. If the data rate were 500kbps (2us bit time) and TCP = 0 (prescaler of 1), then this would mean the second CAN frame will have started 500 * 2us = 1ms after the first CAN frame. 

    Additional register to consider apart from the Timestamp Counter Configuration register (h1020) are the Nominal Bit Timing & Prescaler register (h101C) and the Interrupt register (h1050) if the timestamp wraparound interrupt will be used. 

    Let me know if you  have any more questions.

    Regards,
    Eric Schott

  • Hi Eric,

    Thank you. We have another question from customer as below.

    Customer want to figure out the exact time of CAN message arrival(ta below). They are trying to calculate it by ta=tb-tc. Below is the measurement of the tc between the start of CAN message(8byte) and nINT pulled low.

    Could you tell us how to calculate tc? (data size: 8byte/12byte/32byte/48byte/64byte)

  • Hi Muwei,

    The timestamp counter value is captured at the start of a CAN frame (both TX and RX), so the saved value in this field represents the time ta marked above. 

    Determining the length of tc is difficult because CAN frames do not have a fixed length due to the potential insertion of stuff bits. We would still be able to estimate this value based on the data rate and payload size, but there will be some variance based on the frame contents. Hopefully this is not necessary since the desired time is available in the timestamp itself. 

    Regards,
    Eric Schott

  • Hi Eric,

    Thank you. Customer has another follow up question below.

    - Is it correct that nINT will be pulled low only after received an CAN message, like the one in the previous waveform? Will it be pulled low during the reception?

  • Hi Muwei,

    The nINT pin reflects the state of any enabled interrupt. This includes any of the enabled the MCAN interrupts (h0824) which contain the RFxN (new message in FIFO x). This flag will be set once the entire CAN message is received and the RX FIFO has been updated with the received information. While this will cause nINT to assert at the end of the received CAN frame, the timestamp will store the time in which the received frame started. 

    Regards,
    Eric Schott