<?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 Design Studio中的主题 Re: Using FlexTimer to create microsecond delay</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Using-FlexTimer-to-create-microsecond-delay/m-p/1238775#M10176</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/369"&gt;@danielchen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. Is it not possible to do this without interrupt?. I don't want to use interrupts for this delay routine. Just want execution to stop for the amount of delay specified in microseconds&lt;/P&gt;</description>
    <pubDate>Tue, 02 Mar 2021 15:47:58 GMT</pubDate>
    <dc:creator>keyboardcowboy</dc:creator>
    <dc:date>2021-03-02T15:47:58Z</dc:date>
    <item>
      <title>Using FlexTimer to create microsecond delay</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Using-FlexTimer-to-create-microsecond-delay/m-p/1237432#M10174</link>
      <description>&lt;P&gt;I am trying to use one of the FlexTimer modules to create a&amp;nbsp;microsecond delay function using Kinetis Design Studio (KDS SDK) and K64 MCU. My initialization code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;FTM_DRV_Init(FSL_FLEXTIMER1,&amp;amp;DelayTimer_InitConfig);
FTM_DRV_SetClock(FSL_FLEXTIMER1, kClock_source_FTM_SystemClk, kFtmDividedBy1);
FTM_DRV_SetTimeOverflowIntCmd(FSL_FLEXTIMER1,false);
FTM_DRV_SetFaultIntCmd(FSL_FLEXTIMER1,false);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the actual delay function looks like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void delay_us(uint16_t au16_us)
{
	FTM_Type *ftmBase = g_ftmBase[FSL_FLEXTIMER1];
	FTM_DRV_CounterStart(FSL_FLEXTIMER1, kCounting_FTM_UP, 0x0,0xFFFF, false);
    while (FTM_HAL_GetCounter(ftmBase) &amp;lt; (au16_us*11)){};
    FTM_DRV_CounterStop(FSL_FLEXTIMER1);
    FTM_HAL_SetCounter(ftmBase, 0);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not able to get any delays when I call the function like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;delay_us(500);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My system clock is 20Mhz&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong?. Can anyone help me out?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 19:44:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Using-FlexTimer-to-create-microsecond-delay/m-p/1237432#M10174</guid>
      <dc:creator>keyboardcowboy</dc:creator>
      <dc:date>2021-02-26T19:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using FlexTimer to create microsecond delay</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Using-FlexTimer-to-create-microsecond-delay/m-p/1238365#M10175</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/182921"&gt;@keyboardcowboy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is FTM timer demo in SDK. It demonstrates how to use the FTM driver.&amp;nbsp;It sets up the FTM hardware block to trigger an interrupt every 1 millisecond.&lt;/P&gt;
&lt;P&gt;SDK_2.9.0_FRDM-K64F\boards\frdmk64f\driver_examples\ftm\timer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can download the SDK from below link&lt;/P&gt;
&lt;P&gt;&lt;A href="https://mcuxpresso.nxp.com/en/welcome" target="_blank"&gt;https://mcuxpresso.nxp.com/en/welcome&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 03:08:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Using-FlexTimer-to-create-microsecond-delay/m-p/1238365#M10175</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2021-03-02T03:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using FlexTimer to create microsecond delay</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Using-FlexTimer-to-create-microsecond-delay/m-p/1238775#M10176</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/369"&gt;@danielchen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. Is it not possible to do this without interrupt?. I don't want to use interrupts for this delay routine. Just want execution to stop for the amount of delay specified in microseconds&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 15:47:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Using-FlexTimer-to-create-microsecond-delay/m-p/1238775#M10176</guid>
      <dc:creator>keyboardcowboy</dc:creator>
      <dc:date>2021-03-02T15:47:58Z</dc:date>
    </item>
  </channel>
</rss>

