<?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>Kinetis MicrocontrollersのトピックProblem resetting FTM timers, what is the correct way to do it?</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-resetting-FTM-timers-what-is-the-correct-way-to-do-it/m-p/186856#M2008</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the ftm timer to measure rtos performance, I'm not using systick because it is reserved for the rtos.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The FTM timer is setup to use the core clock but the counter will overflow if performing multiple tests or doing stuff between tests. Therefore I want to reset it between tests.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the clock overflows the counter stops, why doesn't it start over from 0?&lt;/P&gt;&lt;P&gt;If I try to reset the counter by using reset_ftm_timer() it stops.&lt;/P&gt;&lt;P&gt;If i run setup_ftm_timer twice, the counter stops.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include "MK60N512MD100.h"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void setup_ftm_timer()&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SIM-&amp;gt;SCGC6 |= SIM_SCGC6_FTM0_MASK; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FTM0-&amp;gt;SC = 0x0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FTM0-&amp;gt;MODE |= FTM_MODE_WPDIS_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FTM0-&amp;gt;MODE |= FTM_MODE_FTMEN_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FTM0-&amp;gt;CNT = 0x0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FTM0-&amp;gt;CNTIN = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FTM0-&amp;gt;SC = FTM_SC_CLKS(1);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void reset_ftm_timer() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FTM0-&amp;gt;CNT = 0x0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All input and feedback is appreciated&lt;/P&gt;&lt;P&gt;//Zeal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Nov 2011 20:37:20 GMT</pubDate>
    <dc:creator>zeal</dc:creator>
    <dc:date>2011-11-29T20:37:20Z</dc:date>
    <item>
      <title>Problem resetting FTM timers, what is the correct way to do it?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-resetting-FTM-timers-what-is-the-correct-way-to-do-it/m-p/186856#M2008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the ftm timer to measure rtos performance, I'm not using systick because it is reserved for the rtos.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The FTM timer is setup to use the core clock but the counter will overflow if performing multiple tests or doing stuff between tests. Therefore I want to reset it between tests.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the clock overflows the counter stops, why doesn't it start over from 0?&lt;/P&gt;&lt;P&gt;If I try to reset the counter by using reset_ftm_timer() it stops.&lt;/P&gt;&lt;P&gt;If i run setup_ftm_timer twice, the counter stops.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include "MK60N512MD100.h"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void setup_ftm_timer()&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SIM-&amp;gt;SCGC6 |= SIM_SCGC6_FTM0_MASK; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FTM0-&amp;gt;SC = 0x0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FTM0-&amp;gt;MODE |= FTM_MODE_WPDIS_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FTM0-&amp;gt;MODE |= FTM_MODE_FTMEN_MASK;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FTM0-&amp;gt;CNT = 0x0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FTM0-&amp;gt;CNTIN = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FTM0-&amp;gt;SC = FTM_SC_CLKS(1);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void reset_ftm_timer() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;FTM0-&amp;gt;CNT = 0x0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All input and feedback is appreciated&lt;/P&gt;&lt;P&gt;//Zeal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Nov 2011 20:37:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-resetting-FTM-timers-what-is-the-correct-way-to-do-it/m-p/186856#M2008</guid>
      <dc:creator>zeal</dc:creator>
      <dc:date>2011-11-29T20:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem resetting FTM timers, what is the correct way to do it?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-resetting-FTM-timers-what-is-the-correct-way-to-do-it/m-p/186857#M2009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;FTM0-&amp;gt;MOD has to be set, I wrongly assumed leaving it to 0 would behave as setting it to 0xFFFF letting the 16 bit registers overflow..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 17:39:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-resetting-FTM-timers-what-is-the-correct-way-to-do-it/m-p/186857#M2009</guid>
      <dc:creator>zeal</dc:creator>
      <dc:date>2011-11-30T17:39:05Z</dc:date>
    </item>
  </channel>
</rss>

