<?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 Trying to use LPO to clock LPTMR in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273695#M9529</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using a KL14, and cannot seem to get the LPTMR to clock properly from the LPO.&amp;nbsp; I get a single interrupt when the LPTMR is first configured, but never again.&amp;nbsp; I can change the LPTMR clock source to the MCGIRCLK and the interrupt will trigger every time, all the other settings being the same.&amp;nbsp; I'm not using any of the super low power modes, just normal WAIT mode.&amp;nbsp; Has anyone ever seen this issue or have an explanation for it?&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Feb 2014 16:14:52 GMT</pubDate>
    <dc:creator>cburrus</dc:creator>
    <dc:date>2014-02-03T16:14:52Z</dc:date>
    <item>
      <title>Trying to use LPO to clock LPTMR</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273695#M9529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using a KL14, and cannot seem to get the LPTMR to clock properly from the LPO.&amp;nbsp; I get a single interrupt when the LPTMR is first configured, but never again.&amp;nbsp; I can change the LPTMR clock source to the MCGIRCLK and the interrupt will trigger every time, all the other settings being the same.&amp;nbsp; I'm not using any of the super low power modes, just normal WAIT mode.&amp;nbsp; Has anyone ever seen this issue or have an explanation for it?&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Feb 2014 16:14:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273695#M9529</guid>
      <dc:creator>cburrus</dc:creator>
      <dc:date>2014-02-03T16:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use LPO to clock LPTMR</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273696#M9530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bump&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 16:32:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273696#M9530</guid>
      <dc:creator>cburrus</dc:creator>
      <dc:date>2014-02-18T16:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use LPO to clock LPTMR</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273697#M9531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually there is a note on the errata (attached), please review &lt;STRONG&gt;e6060: TSI: Out of Range interrupt shows incorrect behavior with some configurations.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Perla&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 21:16:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273697#M9531</guid>
      <dc:creator>perlam_i_au</dc:creator>
      <dc:date>2014-02-18T21:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use LPO to clock LPTMR</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273698#M9532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My best guess is that you're setting the LPTMR_CSR[TFC] bit which causes the counter to continue counting until it overflows back to zero, instead of resetting back to zero on the initial comparison. If you're literally not changing anything but the clock source, that would definitely explain it. Because the MCGIRCLK is so much faster, it'll cause the LPTMR counter to overflow quickly. The LPO will take a very long time as it's significantly slower. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out the LPTMR code in the KL26 sample code for an example of using the LPO clock for setting up a millisecond timer: \klxx-sc-baremetal\src\drivers\lptmr&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; /* Make sure the clock to the LPTMR is enabled */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SIM_SCGC5|=SIM_SCGC5_LPTMR_MASK;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Reset LPTMR settings */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LPTMR0_CSR=0;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Set the compare value to the number of ms to delay */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LPTMR0_CMR = count_val;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Set up LPTMR to use 1kHz LPO with no prescaler as its clock source */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LPTMR0_PSR = LPTMR_PSR_PCS(1)|LPTMR_PSR_PBYP_MASK;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Start the timer */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LPTMR0_CSR |= LPTMR_CSR_TEN_MASK;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Wait for counter to reach compare value */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; while (!(LPTMR0_CSR &amp;amp; LPTMR_CSR_TCF_MASK));&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Disable counter and Clear Timer Compare Flag */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LPTMR0_CSR &amp;amp;= ~LPTMR_CSR_TEN_MASK;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 13:24:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273698#M9532</guid>
      <dc:creator>anthony_huereca</dc:creator>
      <dc:date>2014-02-19T13:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use LPO to clock LPTMR</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273699#M9533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Had a similar problem like the original poster. And setting the TFC bit was the problem.&lt;/P&gt;&lt;P&gt;If you are setting up a interrupt to be triggered. Only write 1 to TFC bit inside the ISR and nowhere else.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jun 2014 00:32:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273699#M9533</guid>
      <dc:creator>KL04_user</dc:creator>
      <dc:date>2014-06-24T00:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use LPO to clock LPTMR</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273700#M9534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Anthony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where is this directory specifically found?&lt;/P&gt;&lt;P&gt;&lt;STRONG style="background-color: #ffffff; color: #51626f;"&gt;\klxx-sc-baremetal\src\drivers\lptmr&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Also in the code you have written, aren't there any configurations for the CSR register such as setting it as counter mode and enabling the TIE flag? Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;BR,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Jade&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2016 07:30:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273700#M9534</guid>
      <dc:creator>jadeanthonydela</dc:creator>
      <dc:date>2016-08-25T07:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use LPO to clock LPTMR</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273701#M9535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jade,&lt;/P&gt;&lt;P&gt;&amp;nbsp; The files described are in the &lt;A href="http://cache.nxp.com/files/32bit/software/KL25_SC.exe"&gt;KL25 bare-metal sample code &lt;/A&gt;package. However that code has not been updated for a few years, so the recommendation for new designs is to use &lt;A href="http://www.nxp.com/products/software-and-tools/run-time-software/kinetis-software-and-tools/development-platforms-with-mbed/software-development-kit-for-kinetis-mcus:KINETIS-SDK"&gt;Kinetis SDK&lt;/A&gt;&amp;nbsp;which includes an LPTMR example in the&amp;nbsp;\boards\&amp;lt;board_name&amp;gt;\driver_examples\lptmr directory and supports the latest IDEs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The code I put in my response is&amp;nbsp;very basic, so it didn't use interrupts or change the other default LPTMR parameters. It was intended only as a simple example to show how to use the LPO to clock the LPTMR module.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Anthony&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Aug 2016 14:43:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273701#M9535</guid>
      <dc:creator>anthony_huereca</dc:creator>
      <dc:date>2016-08-25T14:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to use LPO to clock LPTMR</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273702#M9536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Anthony, very informative inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jade&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Aug 2016 02:50:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Trying-to-use-LPO-to-clock-LPTMR/m-p/273702#M9536</guid>
      <dc:creator>jadeanthonydela</dc:creator>
      <dc:date>2016-08-26T02:50:15Z</dc:date>
    </item>
  </channel>
</rss>

