<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic FlexCAN Timestamp support in S32K</title>
    <link>https://community.nxp.com/t5/S32K/FlexCAN-Timestamp-support/m-p/1900154#M37208</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I try to calculate CAN Rx message period by using timestamp but it is 16 bit and overflow for higher periods.&amp;nbsp;&lt;/P&gt;&lt;P&gt;for testing, I am sending single CAN message for 100 times (to check fluctuation).&lt;/P&gt;&lt;P&gt;the measurements are like below:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Rx Period (ms)&lt;/TD&gt;&lt;TD width="50%"&gt;Measured timestamp (average)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;10&lt;/TD&gt;&lt;TD width="50%"&gt;5000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;20&lt;/TD&gt;&lt;TD width="50%"&gt;10600&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;50&lt;/TD&gt;&lt;TD width="50%"&gt;25000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;100&lt;/TD&gt;&lt;TD width="50%"&gt;50000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;200&lt;/TD&gt;&lt;TD width="50%"&gt;34470 ( + 65535(overflow) = 100000)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;1000&lt;/TD&gt;&lt;TD width="50%"&gt;41200&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;2000&lt;/TD&gt;&lt;TD width="50%"&gt;17000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;573 (this fluctuate between 125 and 1000)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The baudrate is 500 kbps and FlexCAN runs at 80 Mhz.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;How can 500 is approximately refers to 1ms?&lt;/LI&gt;&lt;LI&gt;It seems there is a correlation but timestamp is 16bit and only counts to 65535. So, it overflows at 200ms for example. How can I understand if it overflows and how many times?&lt;/LI&gt;&lt;LI&gt;How can I activate HR timestamp as seen at below? I am using RTD 3.0.0 with S32DS 3.5&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erinc_0-1720176272844.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/287284i81C775EAAA9DEAAE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="erinc_0-1720176272844.png" alt="erinc_0-1720176272844.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is there a way to change CTRL2?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jul 2024 10:46:17 GMT</pubDate>
    <dc:creator>anakha</dc:creator>
    <dc:date>2024-07-05T10:46:17Z</dc:date>
    <item>
      <title>FlexCAN Timestamp support</title>
      <link>https://community.nxp.com/t5/S32K/FlexCAN-Timestamp-support/m-p/1900154#M37208</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I try to calculate CAN Rx message period by using timestamp but it is 16 bit and overflow for higher periods.&amp;nbsp;&lt;/P&gt;&lt;P&gt;for testing, I am sending single CAN message for 100 times (to check fluctuation).&lt;/P&gt;&lt;P&gt;the measurements are like below:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Rx Period (ms)&lt;/TD&gt;&lt;TD width="50%"&gt;Measured timestamp (average)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;10&lt;/TD&gt;&lt;TD width="50%"&gt;5000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;20&lt;/TD&gt;&lt;TD width="50%"&gt;10600&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;50&lt;/TD&gt;&lt;TD width="50%"&gt;25000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;100&lt;/TD&gt;&lt;TD width="50%"&gt;50000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;200&lt;/TD&gt;&lt;TD width="50%"&gt;34470 ( + 65535(overflow) = 100000)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;1000&lt;/TD&gt;&lt;TD width="50%"&gt;41200&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;2000&lt;/TD&gt;&lt;TD width="50%"&gt;17000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;573 (this fluctuate between 125 and 1000)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The baudrate is 500 kbps and FlexCAN runs at 80 Mhz.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;How can 500 is approximately refers to 1ms?&lt;/LI&gt;&lt;LI&gt;It seems there is a correlation but timestamp is 16bit and only counts to 65535. So, it overflows at 200ms for example. How can I understand if it overflows and how many times?&lt;/LI&gt;&lt;LI&gt;How can I activate HR timestamp as seen at below? I am using RTD 3.0.0 with S32DS 3.5&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erinc_0-1720176272844.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/287284i81C775EAAA9DEAAE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="erinc_0-1720176272844.png" alt="erinc_0-1720176272844.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is there a way to change CTRL2?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 10:46:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/FlexCAN-Timestamp-support/m-p/1900154#M37208</guid>
      <dc:creator>anakha</dc:creator>
      <dc:date>2024-07-05T10:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: FlexCAN Timestamp support</title>
      <link>https://community.nxp.com/t5/S32K/FlexCAN-Timestamp-support/m-p/1903656#M37365</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@erinc" target="_blank"&gt;Hi@erinc&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I am working on your question.&lt;/P&gt;
&lt;P&gt;It will take some time because there are fewer questions about FlexCAN Timestamp.&lt;/P&gt;
&lt;P&gt;I need some time to do some testing.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 06:42:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/FlexCAN-Timestamp-support/m-p/1903656#M37365</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2024-07-09T06:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: FlexCAN Timestamp support</title>
      <link>https://community.nxp.com/t5/S32K/FlexCAN-Timestamp-support/m-p/1904149#M37421</link>
      <description>&lt;P&gt;&lt;A href="mailto:Hi@erinc" target="_blank" rel="noopener"&gt;Hi@erinc&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Q1.How can 500 is approximately refers to 1ms?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I think you have misunderstood. This timestamp should be the interval between the start or end of each frame, not the time it takes for a frame to be transmitted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Q2.It seems there is a correlation but timestamp is 16bit and only counts to 65535. So, it overflows at 200ms for example. How can I understand if it overflows and how many times?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Yes, the default is the Free running 16-bit timer, which has no overflow flag(i didn't see), but you can set CRTL1[TSYN] = 1, so that the timer will automatically reset after receivied Frame.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Q3.How can I activate HR timestamp as seen at below? I am using RTD 3.0.0 with S32DS 3.5&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;a.You need to enable the following options:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Senlent_0-1720519877698.png" style="width: 549px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/287762iA10FEC771F6AD403/image-dimensions/549x192?v=v2" width="549" height="192" role="button" title="Senlent_0-1720519877698.png" alt="Senlent_0-1720519877698.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;b.&lt;/STRONG&gt;You need to configure Stm for HR timestamp.(ps,:you can refer to "Stm_Gpt_Example_S32k344")&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;c.&lt;/STRONG&gt;Read HR timestamp, for example:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;temp = (uint32)IP_CAN_0-&amp;gt;HR_TIME_STAMP[mb_idx];&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Also,You can enable the interrupt of Stm and record the number of overflows of Stm&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 10:18:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/FlexCAN-Timestamp-support/m-p/1904149#M37421</guid>
      <dc:creator>Senlent</dc:creator>
      <dc:date>2024-07-09T10:18:20Z</dc:date>
    </item>
  </channel>
</rss>

