<?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 Re: Free-running timer TPM on KL17Z in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-running-timer-TPM-on-KL17Z/m-p/1025955#M56366</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes indeed, I proceed as you suggested and the timer is running as expected but writing this code in my IRQ sampling process&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;timeStamp[tmStmpIdx] = TPM_GetCurrentTimerCount(TPM2);
tmStmpIdx++;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;leads to the same results on the timeStamp array and I cannot see any increment on their values. Any hint?&lt;/P&gt;&lt;P&gt;How can I reset the timer counter?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;gaston&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Feb 2020 08:59:07 GMT</pubDate>
    <dc:creator>gschelotto</dc:creator>
    <dc:date>2020-02-28T08:59:07Z</dc:date>
    <item>
      <title>Free-running timer TPM on KL17Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-running-timer-TPM-on-KL17Z/m-p/1025953#M56364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd need to implement a free-running timer using TPM timer without IRQ in order to get successive time-stamps between acquisition data samples. I know the concept is easy and trivial but I'm trying to do it using the latest SDK for KL17Z with no success. I'm also not able to find any TPM SDK examples with such behavior. Can anyone help me with this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;BR /&gt;gaston&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2020 18:12:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-running-timer-TPM-on-KL17Z/m-p/1025953#M56364</guid>
      <dc:creator>gschelotto</dc:creator>
      <dc:date>2020-02-27T18:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Free-running timer TPM on KL17Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-running-timer-TPM-on-KL17Z/m-p/1025954#M56365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;gaston,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Have you try to refer the tpm_timer example in SDK_2.7.0_MKL17Z64xxx4?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="tpm_timer.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/99134i21DD6303A2A48961/image-size/large?v=v2&amp;amp;px=999" role="button" title="tpm_timer.png" alt="tpm_timer.png" /&gt;&lt;/span&gt;&lt;BR /&gt;enableStopOnOverflow = false; means TPM counter continues running after overflow.&lt;BR /&gt;You can disable below IRQ related codes.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="enableStopOnOverflow.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/99172iDD66AD01F65FBF0C/image-size/large?v=v2&amp;amp;px=999" role="button" title="enableStopOnOverflow.png" alt="enableStopOnOverflow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Seems that you don't need to interrupt 1ms anymore, so configure MOD=0xffff by using TPM_SetTimerPeriod function.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="TPM_SetTimerPeriod.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/99210iD71449A048EC6FEC/image-size/large?v=v2&amp;amp;px=999" role="button" title="TPM_SetTimerPeriod.png" alt="TPM_SetTimerPeriod.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Best Regards,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Robin&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2020 06:17:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-running-timer-TPM-on-KL17Z/m-p/1025954#M56365</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2020-02-28T06:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Free-running timer TPM on KL17Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-running-timer-TPM-on-KL17Z/m-p/1025955#M56366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes indeed, I proceed as you suggested and the timer is running as expected but writing this code in my IRQ sampling process&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;timeStamp[tmStmpIdx] = TPM_GetCurrentTimerCount(TPM2);
tmStmpIdx++;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;leads to the same results on the timeStamp array and I cannot see any increment on their values. Any hint?&lt;/P&gt;&lt;P&gt;How can I reset the timer counter?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;gaston&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2020 08:59:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-running-timer-TPM-on-KL17Z/m-p/1025955#M56366</guid>
      <dc:creator>gschelotto</dc:creator>
      <dc:date>2020-02-28T08:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Free-running timer TPM on KL17Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-running-timer-TPM-on-KL17Z/m-p/1025956#M56367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved.&lt;/P&gt;&lt;P&gt;At the end I used the Systick timer as free-running timer and it works as expected. Here's the code inside the sampling routine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;    tmp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; SysTick&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;VAL&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;// SysTick Reload Value register supports values between 1 and 0x00FFFFFF.&lt;/SPAN&gt;
    SysTick&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;LOAD &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0x00FFFFFF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    SysTick&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;VAL &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    tmp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0x00FFFFFF&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; tmp&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    timeStamp&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;tmStmpIdx&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;COUNT_TO_USEC&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;tmp&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;CLOCK_GetFreq&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;kCLOCK_CoreSysClk&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    tmStmpIdx&lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;BR /&gt;gaston&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2020 11:40:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-running-timer-TPM-on-KL17Z/m-p/1025956#M56367</guid>
      <dc:creator>gschelotto</dc:creator>
      <dc:date>2020-02-28T11:40:31Z</dc:date>
    </item>
  </channel>
</rss>

