2018 Microchip Technology Inc. DS70005340A-page 103
CAN FD Protocol Module
11.0 TIMESTAMPING
The CAN FD Protocol Module contains a Time Base Counter (TBC). The TBC is a 32-bit free-running
counter that increments on multiples of SYSCLK and rolls over to zero when:
• TBCPRE<9:0> bits (C1TSCONL<9:0>) are used to configure the prescaler for the TBC.
• Setting TBCEN (C1TSCONH<0>) enables the TBC.
• Clearing TBCEN disables, stops and resets the TBC.
• The TBC has to be disabled before writing to C1TBCH/L by clearing TBCEN.
• TEFTSEN (C1TEFCONL<5>) has to be set to timestamp messages in the TEF.
• RXTSEN (C1FIFOCONxL<5>) has to be set to timestamp messages in the individual
RX FIFO.
• The application can read C1TBCH/L at any time. Similar to any multibyte counter, the
application has to consider that the counter increments and might roll over while reading
different bytes of the counter.
All timestamps are 32 bits, allowing timestamps to be used for system time synchronization with
high resolution.
A rollover of the TBC will generate an interrupt if TBCIE is set.
Messages can be timestamped either at the beginning of a frame or at the end, depending on
the TSEOF bit (C1TSCONH<1>). When TSEOF = 0, TSRES (C1TSCONH<2>) specifies if FD
frames are timestamped at SOF or the “reserved bit”. Table 11-1 specifies the reference points
when the timestamping occurs. At the reference point, the value of the TBC (C1TBCH/L) is
captured and stored into the message object:
• Receive Message Object: The TBC value is stored in the RXMSGTSx bits (see Tabl e 9- 1 )
• TEF Object: The TBC value is stored in the TXMSGTSx bits (see Table 7 - 1 )
Table 11-1: Reference Point
Frame CAN 2.0 CAN FD
Start of TX Sample point of SOF Sample point of SOF or the bit after FDF
Start of RX Sample point of SOF Sample point of SOF or the bit after FDF
Valid TX No error till end of EOF No error till end of EOF
Valid RX No error till the last, but one bit of
EOF
No error till the last, but one bit of EOF