<?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 Delay calculations in FRDM KL25Z! in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Delay-calculations-in-FRDM-KL25Z/m-p/1093337#M57764</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kindly requesting assistance in writing a delay subroutine to generate a 1 sec delay in FRDMKL25Z ( clock is 48MHz) ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Aug 2020 11:51:16 GMT</pubDate>
    <dc:creator>suma_success</dc:creator>
    <dc:date>2020-08-14T11:51:16Z</dc:date>
    <item>
      <title>Delay calculations in FRDM KL25Z!</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Delay-calculations-in-FRDM-KL25Z/m-p/1093337#M57764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kindly requesting assistance in writing a delay subroutine to generate a 1 sec delay in FRDMKL25Z ( clock is 48MHz) ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2020 11:51:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Delay-calculations-in-FRDM-KL25Z/m-p/1093337#M57764</guid>
      <dc:creator>suma_success</dc:creator>
      <dc:date>2020-08-14T11:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Delay calculations in FRDM KL25Z!</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Delay-calculations-in-FRDM-KL25Z/m-p/1093338#M57765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suma,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For generate a delay there are&amp;nbsp;two general paths,&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; write a subroutine using a for loop and nop operations.&lt;/P&gt;&lt;P&gt;2&amp;nbsp;Use a Timer /counter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would choose the timer&amp;nbsp;because provides interrupts and&amp;nbsp;that enables you&amp;nbsp;to perform blocking as non-blocking delays and&amp;nbsp; it is easier to generate more accurate delays.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;You could refer to FRDM-KL52Z SDK&amp;nbsp;PIT example &lt;/STRONG&gt;(SDK installation instructions&lt;A href="https://www.nxp.com/design/training/mcu-tech-minutes-importing-an-sdk-package-into-mcuxpresso-ide:TIP-IMPORTING-AN-SDK-PACKAGE-INTO-MCUXPRESSO-IDE"&gt; here&lt;/A&gt;).&amp;nbsp; This example demonstrates the&amp;nbsp;implementation of the Periodic interrupt timer&amp;nbsp; or PIT&amp;nbsp; for toggle an LED each second.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe that you could use the example as reference for your application.&amp;nbsp; Please look at the &lt;A href="https://mcuxpresso.nxp.com/api_doc/dev/210/group__pit.html"&gt;SDK documentation&lt;/A&gt; to get more details on the PIT timer driver.&amp;nbsp; For example, if you wish to stop the timer you could call&lt;STRONG&gt;&lt;EM&gt; PIT_StopTimer(...)&lt;/EM&gt; &lt;/STRONG&gt;function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another, detail is that PIT timer period it is calculated upon your clock frequency, so you can relax a bit with this topic:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#define&lt;STRONG&gt; PIT_SOURCE_CLOCK&lt;/STRONG&gt; CLOCK_GetFreq(kCLOCK_BusClk)&lt;/P&gt;&lt;P&gt;&amp;nbsp;PIT_SetTimerPeriod(PIT, kPIT_Chnl_0, USEC_TO_COUNT(1000000U, &lt;STRONG&gt;PIT_SOURCE_CLOCK&lt;/STRONG&gt;));&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;Yours,&lt;/P&gt;&lt;P&gt;Diego&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2020 15:24:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Delay-calculations-in-FRDM-KL25Z/m-p/1093338#M57765</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2020-08-18T15:24:55Z</dc:date>
    </item>
  </channel>
</rss>

