<?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: I am trying to toggle the red led using TPM0_interrupt on FRDM-KL43Z in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-trying-to-toggle-the-red-led-using-TPM0-interrupt-on-FRDM/m-p/510349#M32232</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;/P&gt;&lt;P&gt;I have checked the clock.It is 8MHZ.I tried the same with LPTMR and PIT.It worked well.I am facing problem with TPM.&lt;/P&gt;&lt;P&gt;anyway i will go through it again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankyou.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Apr 2016 11:41:56 GMT</pubDate>
    <dc:creator>priyankavorugan</dc:creator>
    <dc:date>2016-04-19T11:41:56Z</dc:date>
    <item>
      <title>I am trying to toggle the red led using TPM0_interrupt on FRDM-KL43Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-trying-to-toggle-the-red-led-using-TPM0-interrupt-on-FRDM/m-p/510345#M32228</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 am trying to toggle the red led using TPM0 _interrupt on FRDM-KL43Z board. I selected MCGIRCLK(8MHZ) as TPM clock source. &lt;/P&gt;&lt;P&gt;Since the prescaler is 2, the TPM clock period is 0.25microseconds.I&amp;nbsp; am loading the TPM_MOD register with 8000 so that the ON and OFF period of led is 2ms .&lt;/P&gt;&lt;P&gt;But the problem is irrespective of the value loaded in the TPM_MOD register the ON and OFF periods are 16.80ms and 16ms respectively. The following is the code .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SIM_SCGC6 |= SIM_SCGC6_TPM0_MASK ; //enable the clock for TPM0 module&lt;/P&gt;&lt;P&gt; SIM_SOPT2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |= SIM_SOPT2_TPMSRC_MASK ; //MCGIRCLK as clock source&lt;/P&gt;&lt;P&gt; TPM0_CONF&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |= TPM_CONF_DBGMODE_MASK ; // increment the counter in debug mode&lt;/P&gt;&lt;P&gt; TPM0_SC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |= TPM_SC_PS(1); //PRESCALER IS 2&lt;/P&gt;&lt;P&gt; TPM0_SC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |= TPM_SC_CPWMS_upcounting ; //up counting is selected(0x08u)&lt;/P&gt;&lt;P&gt; TPM0_CNT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |= TPM_CNT_COUNT_MASK ; //clear the counter value&lt;/P&gt;&lt;P&gt; TPM0_MOD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |= TPM_MOD_MOD(8000); // to get a delay of 2msec&lt;/P&gt;&lt;P&gt; TPM0_SC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |= TPM_SC_TOF_MASK ; // clear the interrupt flag&lt;/P&gt;&lt;P&gt; TPM0_SC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |= TPM_SC_TOIE_MASK; //enable the interrupt&lt;/P&gt;&lt;P&gt; TPM0_SC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |= TPM_SC_CMOD(2); //TPM counter increments on every TPM counter clock&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 05:19:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-trying-to-toggle-the-red-led-using-TPM0-interrupt-on-FRDM/m-p/510345#M32228</guid>
      <dc:creator>priyankavorugan</dc:creator>
      <dc:date>2016-04-18T05:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to toggle the red led using TPM0_interrupt on FRDM-KL43Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-trying-to-toggle-the-red-led-using-TPM0-interrupt-on-FRDM/m-p/510346#M32229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;About "But the problem is irrespective of the value loaded in the TPM_MOD register the ON and OFF periods are 16.80ms and 16ms respectively."&amp;nbsp; Do you meaning no matter what the TPM_MOD is , the ON time is 16.8ms, the OFF time is 16ms,&lt;/P&gt;&lt;P&gt;or you want set the e ON and OFF periods are 16.80ms and 16ms&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 10:09:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-trying-to-toggle-the-red-led-using-TPM0-interrupt-on-FRDM/m-p/510346#M32229</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2016-04-18T10:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to toggle the red led using TPM0_interrupt on FRDM-KL43Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-trying-to-toggle-the-red-led-using-TPM0-interrupt-on-FRDM/m-p/510347#M32230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;since i have loaded the mod reg with 8000 , the ON and OFF period should be 2ms.But when i measure it using DSO i am getting 16.80 ms nd 16ms respectively.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 11:41:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-trying-to-toggle-the-red-led-using-TPM0-interrupt-on-FRDM/m-p/510347#M32230</guid>
      <dc:creator>priyankavorugan</dc:creator>
      <dc:date>2016-04-18T11:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to toggle the red led using TPM0_interrupt on FRDM-KL43Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-trying-to-toggle-the-red-led-using-TPM0-interrupt-on-FRDM/m-p/510348#M32231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Priyanka,&lt;/P&gt;&lt;P&gt;I create one TPM project about FRDM-KL43 on KDS refer to your parameter.&lt;/P&gt;&lt;P&gt;If you do not have the KDS IDE, i can show the registers:&lt;/P&gt;&lt;P&gt;selected MCGIRCLK(8MHZ) as TPM clock source;&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/32498i9EF10F2CD1C1C9B5/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_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/32587i5894191ED5A00D31/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;the prescaler is 2;&lt;/P&gt;&lt;P&gt;TPM_MOD register with 8000;&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/32622i3600CA548FDDDC4B/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;and it can work well , each 2ms it will enter the interrupt and toggle the PTD5(LED) .&lt;/P&gt;&lt;P&gt;I check the waveform on the scope, it is right :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/32720i62DFEBB3B463CBA7/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I also attached my project , you can use the KDS+KSDK to check it .&lt;/P&gt;&lt;P&gt;And about your code , please be sure whether the MCGIRCLK is 8M.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Alice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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>Tue, 19 Apr 2016 09:59:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-trying-to-toggle-the-red-led-using-TPM0-interrupt-on-FRDM/m-p/510348#M32231</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2016-04-19T09:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to toggle the red led using TPM0_interrupt on FRDM-KL43Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-trying-to-toggle-the-red-led-using-TPM0-interrupt-on-FRDM/m-p/510349#M32232</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;/P&gt;&lt;P&gt;I have checked the clock.It is 8MHZ.I tried the same with LPTMR and PIT.It worked well.I am facing problem with TPM.&lt;/P&gt;&lt;P&gt;anyway i will go through it again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankyou.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2016 11:41:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-trying-to-toggle-the-red-led-using-TPM0-interrupt-on-FRDM/m-p/510349#M32232</guid>
      <dc:creator>priyankavorugan</dc:creator>
      <dc:date>2016-04-19T11:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to toggle the red led using TPM0_interrupt on FRDM-KL43Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-trying-to-toggle-the-red-led-using-TPM0-interrupt-on-FRDM/m-p/510350#M32233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Priyanka,&lt;/P&gt;&lt;P&gt;Do you meaning no matter what the MOD register is , the interrupt timer is 16ms,&lt;/P&gt;&lt;P&gt;and you also be sure your code without any problem , maybe the TPM part have some&lt;/P&gt;&lt;P&gt;problem of your chip .&lt;/P&gt;&lt;P&gt;And you also can test my project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 08:59:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/I-am-trying-to-toggle-the-red-led-using-TPM0-interrupt-on-FRDM/m-p/510350#M32233</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2016-04-20T08:59:47Z</dc:date>
    </item>
  </channel>
</rss>

