66.5.2 Timestamp Generation
For timestamp generation, the MCAN supplies a 16-bit wrap-around counter. A prescaler (MCAN_TSCC.TCP) can be configured to clock the counter in multiples of CAN bit times (1…16). The counter is readable via MCAN_TSCV.TSC. A write access to the Timestamp Counter Value register (MCAN_TSCV) resets the counter to zero. When the timestamp counter wraps around, the interrupt flag MCAN_IR.TSW is set.
On start of frame (SOF) reception/transmission, the counter value is captured and stored in the timestamp section of an Rx Buffer/Rx FIFO (RXTS[15:0]) or Tx Event FIFO (TXTS[15:0]) element.
MCAN_TSCC.TSS can be used to capture the external 16-bit timebase vector input of the MCAN as timestamp instead of the internal 16-bit counter.