<?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 Fex timer sample code in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fex-timer-sample-code/m-p/412609#M23422</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using SKEAZN64MLC controller in my project,&lt;/P&gt;&lt;P&gt;Now i need to implement some timer logic for my requirement.&lt;/P&gt;&lt;P&gt;I need to keep on count the timer count value, once counter value greater than some predefined value , then i need to stop timer.&lt;/P&gt;&lt;P&gt;and again start the timer by count value initializing to 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. How to start and stop flex timer?.&lt;/P&gt;&lt;P&gt;2. How to initialize the timer to count for 1 us.?.&lt;/P&gt;&lt;P&gt;void FTM_Init()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIM-&amp;gt;SCGC |= SIM_SCGC_FTM2_MASK; /* Enable Clock for FTM2 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTM2-&amp;gt;SC |= FTM_SC_PS(3);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTM2-&amp;gt;SC |= FTM_SC_CLKS(3); /*FTM2 use system clock*/&lt;/P&gt;&lt;P&gt;// external clock is 8MHZ so 8/2^3=1mhz so timer increment for each 1 us. &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;is this correct?.&lt;/P&gt;&lt;P&gt;3. is timer count will automatically update to FTM2-&amp;gt;CNT or need to capture every time?.&lt;/P&gt;&lt;P&gt;Basically i need to set of sample codes for flex timers , kindly share to me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 26 Sep 2015 08:11:51 GMT</pubDate>
    <dc:creator>punithb</dc:creator>
    <dc:date>2015-09-26T08:11:51Z</dc:date>
    <item>
      <title>Fex timer sample code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fex-timer-sample-code/m-p/412609#M23422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using SKEAZN64MLC controller in my project,&lt;/P&gt;&lt;P&gt;Now i need to implement some timer logic for my requirement.&lt;/P&gt;&lt;P&gt;I need to keep on count the timer count value, once counter value greater than some predefined value , then i need to stop timer.&lt;/P&gt;&lt;P&gt;and again start the timer by count value initializing to 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. How to start and stop flex timer?.&lt;/P&gt;&lt;P&gt;2. How to initialize the timer to count for 1 us.?.&lt;/P&gt;&lt;P&gt;void FTM_Init()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIM-&amp;gt;SCGC |= SIM_SCGC_FTM2_MASK; /* Enable Clock for FTM2 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTM2-&amp;gt;SC |= FTM_SC_PS(3);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTM2-&amp;gt;SC |= FTM_SC_CLKS(3); /*FTM2 use system clock*/&lt;/P&gt;&lt;P&gt;// external clock is 8MHZ so 8/2^3=1mhz so timer increment for each 1 us. &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;is this correct?.&lt;/P&gt;&lt;P&gt;3. is timer count will automatically update to FTM2-&amp;gt;CNT or need to capture every time?.&lt;/P&gt;&lt;P&gt;Basically i need to set of sample codes for flex timers , kindly share to me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Sep 2015 08:11:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fex-timer-sample-code/m-p/412609#M23422</guid>
      <dc:creator>punithb</dc:creator>
      <dc:date>2015-09-26T08:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Fex timer sample code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fex-timer-sample-code/m-p/412610#M23423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;Which IDE do you use ?&lt;/P&gt;&lt;P&gt;If you use KDS, i recommend you create one PE project , then add the "Init_FTM" component or "TimerOut_LDD" component ,&lt;/P&gt;&lt;P&gt; then generate code ,&amp;nbsp; you can find the configuration about the FTM.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/58240i8EDB70C770838CD7/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 03:31:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fex-timer-sample-code/m-p/412610#M23423</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2015-09-29T03:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Fex timer sample code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fex-timer-sample-code/m-p/412611#M23424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alice,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks for your reply.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Yes i am using KDS.&lt;/P&gt;&lt;P&gt;I created on PE Project and now i called the function spi_init() in main, now how to generate code for this?.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Punith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 06:58:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fex-timer-sample-code/m-p/412611#M23424</guid>
      <dc:creator>punithb</dc:creator>
      <dc:date>2015-09-29T06:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Fex timer sample code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fex-timer-sample-code/m-p/412612#M23425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call the function spi_init() ???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want use the flex timer , please add the component of "Init_FTM" or "TimerOut_LDD",&lt;/P&gt;&lt;P&gt;then configure it , then click generate code button here :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/58084i708C1FBD15B271EC/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you can fund the generated code here :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/58036i22E88C9B3F9D2BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/58128i6E01E56ED9622FB4/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If still have any question, please send your project to me . I use KDS3.0 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 09:58:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fex-timer-sample-code/m-p/412612#M23425</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2015-09-29T09:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Fex timer sample code</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fex-timer-sample-code/m-p/412613#M23426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you address this issue? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/376689"&gt;SPI example code for loop back is not working for TRK-KE64 board&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 11:31:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fex-timer-sample-code/m-p/412613#M23426</guid>
      <dc:creator>punithb</dc:creator>
      <dc:date>2015-09-29T11:31:30Z</dc:date>
    </item>
  </channel>
</rss>

