<?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: Generate Custom pulse with S32K144 in S32K</title>
    <link>https://community.nxp.com/t5/S32K/Generate-Custom-pulse-with-S32K144/m-p/1830738#M33148</link>
    <description>&lt;P&gt;For starting, I was only running the FTM timer with periodic interrupt (following the SDK example code). My system clock is 80MHZ but unable to figure out why interrupt is occurring at 86.2 KHZ (Around). Sharing the code and registers data. any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;ftm_state_t ftm_state;

/* Global configuration of flexTimer_mc_1 InitConfig 0 */
ftm_user_config_t flexTimer_mc_1_InitConfig_0 =
{
    {
        true,    /* Software trigger state */
        false,  /* Hardware trigger 1 state */
        false,  /* Hardware trigger 2 state */
        false,  /* Hardware trigger 3 state */
        false, /* Max loading point state */
        false, /* Min loading point state */
        FTM_SYSTEM_CLOCK, /* Update mode for INVCTRL register */
        FTM_SYSTEM_CLOCK, /* Update mode for SWOCTRL register */
        FTM_SYSTEM_CLOCK, /* Update mode for OUTMASK register */
        FTM_SYSTEM_CLOCK, /* Update mode for CNTIN register */
        false, /* Automatic clear of the trigger*/
        FTM_UPDATE_NOW, /* Synchronization point */
    },
        FTM_MODE_UP_TIMER, /* Mode of operation for FTM */
        FTM_CLOCK_DIVID_BY_1, /* FTM clock prescaler */
        FTM_CLOCK_SOURCE_SYSTEMCLK,   /* FTM clock source */
        FTM_BDM_MODE_11, /* FTM debug mode */
        true,    /* Interrupt state */
        false     /* Initialization trigger */
};

void FTM0_Ovf_Reload_IRQHandler(void)
{
    PINS_DRV_TogglePins(LED1_CTRL_GPIO, (1 &amp;lt;&amp;lt; LED1_CTRL_PIN));
    FTM_DRV_ClearStatusFlags(0, (uint32_t)FTM_TIME_OVER_FLOW_FLAG);
}


/* Timer mode configuration for flexTimer_mc_1 TimerConfig 0 */
ftm_timer_param_t flexTimer_mc_1_TimerConfig_0 =
{
        FTM_MODE_UP_TIMER, /* Counter mode */
        0, /* Initial counter value */
        3, //48000 /* Final counter value */
};


void run_demo_led(void){
	    /* Initialize FTM */
    FTM_DRV_Init(0, &amp;amp;flexTimer_mc_1_InitConfig_0, &amp;amp;ftm_state);

    /* Initialize counter */
    FTM_DRV_InitCounter(0, &amp;amp;flexTimer_mc_1_TimerConfig_0);

    /* Start Counter */
    FTM_DRV_CounterStart(0);
	
		while(1){
			
		}
}


{
        .clockName        = FTM0_CLK,
        .clkGate          = true,
        .clksrc=CLK_SRC_SPLL_DIV1, //CLK_SRC_SIRC_DIV1,
        .frac             = MULTIPLY_BY_ONE,
        .divider          = DIVIDE_BY_ONE,
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chandan_uv_3-1710826920278.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269084iC5A593E58472FE5B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chandan_uv_3-1710826920278.jpeg" alt="chandan_uv_3-1710826920278.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chandan_uv_0-1710826688006.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269081i1281113E17C9096C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chandan_uv_0-1710826688006.png" alt="chandan_uv_0-1710826688006.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chandan_uv_1-1710826707563.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269082i9073182F3610C37C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chandan_uv_1-1710826707563.png" alt="chandan_uv_1-1710826707563.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chandan_uv_2-1710826756393.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269083iD85B86093C72E7FF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chandan_uv_2-1710826756393.png" alt="chandan_uv_2-1710826756393.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Mar 2024 05:43:50 GMT</pubDate>
    <dc:creator>chandan_uv</dc:creator>
    <dc:date>2024-03-19T05:43:50Z</dc:date>
    <item>
      <title>Generate Custom pulse with S32K144</title>
      <link>https://community.nxp.com/t5/S32K/Generate-Custom-pulse-with-S32K144/m-p/1829344#M33053</link>
      <description>&lt;P&gt;Hi, I need to generate custom 400khz pulse where pin output should be changed in 0.4us. I don't want to overload CPU. do u have example code which I can refer to generate the pulse using PWM with DMA or FlexIO. Which method should I choose? I need to send data stream using below protocol.&amp;nbsp; Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chandan_uv_0-1710499215274.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/268669i26A1D742B7A29EB7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chandan_uv_0-1710499215274.png" alt="chandan_uv_0-1710499215274.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chandan_uv_1-1710499236002.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/268670iA04FD68E0F8F806F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chandan_uv_1-1710499236002.png" alt="chandan_uv_1-1710499236002.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 10:41:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Generate-Custom-pulse-with-S32K144/m-p/1829344#M33053</guid>
      <dc:creator>chandan_uv</dc:creator>
      <dc:date>2024-03-15T10:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Custom pulse with S32K144</title>
      <link>https://community.nxp.com/t5/S32K/Generate-Custom-pulse-with-S32K144/m-p/1829639#M33069</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/215611"&gt;@chandan_uv&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You can find examples for a PWM signal with the FTM module through the &lt;A href="https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=SW32K1-RTD44-D" target="_self"&gt;S32K1 RTD package,&lt;/A&gt;&amp;nbsp;or the PWM examples from the &lt;A href="https://www.nxp.com/design/design-center/software/development-software/s32-sdk/s32-software-development-kit-for-s32k1:S32SDK-ARMK1" target="_self"&gt;SDK RTM package&lt;/A&gt;. Please look into the&amp;nbsp;&lt;A href="https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/S32DS-list-of-HOWTOs/ta-p/1113475" target="_blank"&gt;list of HOWTOs&lt;/A&gt;&amp;nbsp;for guides on installation and how to import the examples.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Julin_AragnM_2-1710539654659.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/268755i924D375EAFC97136/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Julin_AragnM_2-1710539654659.png" alt="Julin_AragnM_2-1710539654659.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Julin_AragnM_0-1710539511483.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/268753i782415677A44C894/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Julin_AragnM_0-1710539511483.png" alt="Julin_AragnM_0-1710539511483.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Julián&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 21:54:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Generate-Custom-pulse-with-S32K144/m-p/1829639#M33069</guid>
      <dc:creator>Julián_AragónM</dc:creator>
      <dc:date>2024-03-15T21:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Custom pulse with S32K144</title>
      <link>https://community.nxp.com/t5/S32K/Generate-Custom-pulse-with-S32K144/m-p/1829949#M33092</link>
      <description>&lt;P&gt;can you let me know how I can download all example code for S32K1xx? Also is there any better method to offload CPU?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 05:30:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Generate-Custom-pulse-with-S32K144/m-p/1829949#M33092</guid>
      <dc:creator>chandan_uv</dc:creator>
      <dc:date>2024-03-18T05:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Custom pulse with S32K144</title>
      <link>https://community.nxp.com/t5/S32K/Generate-Custom-pulse-with-S32K144/m-p/1830505#M33137</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/215611"&gt;@chandan_uv&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the previous links, you can find two packages:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Real Time Drivers&lt;/LI&gt;
&lt;LI&gt;Automotive SDK&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Real Time Drivers can be downloaded as UpdateSite extensions and installed in S32 Design Studio with the &lt;EM&gt;Extensions and Updates&lt;/EM&gt; window:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Julin_AragnM_1-1710787427148.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269023iD2022DB52F9D4DCA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Julin_AragnM_1-1710787427148.png" alt="Julin_AragnM_1-1710787427148.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Julin_AragnM_0-1710787184733.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269022iD7647F9D63C92D39/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Julin_AragnM_0-1710787184733.png" alt="Julin_AragnM_0-1710787184733.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;After this, a project example can be imported:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Julin_AragnM_2-1710787559500.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269024i0BAD7552845CCC09/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Julin_AragnM_2-1710787559500.png" alt="Julin_AragnM_2-1710787559500.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Please refer to the &lt;A href="https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/S32DS-list-of-HOWTOs/ta-p/1113475" target="_self"&gt;HOWTO&lt;/A&gt; links for guides on installation, how to import the examples and how to create projects from these packages.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Julián&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 18:46:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Generate-Custom-pulse-with-S32K144/m-p/1830505#M33137</guid>
      <dc:creator>Julián_AragónM</dc:creator>
      <dc:date>2024-03-18T18:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Custom pulse with S32K144</title>
      <link>https://community.nxp.com/t5/S32K/Generate-Custom-pulse-with-S32K144/m-p/1830738#M33148</link>
      <description>&lt;P&gt;For starting, I was only running the FTM timer with periodic interrupt (following the SDK example code). My system clock is 80MHZ but unable to figure out why interrupt is occurring at 86.2 KHZ (Around). Sharing the code and registers data. any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;ftm_state_t ftm_state;

/* Global configuration of flexTimer_mc_1 InitConfig 0 */
ftm_user_config_t flexTimer_mc_1_InitConfig_0 =
{
    {
        true,    /* Software trigger state */
        false,  /* Hardware trigger 1 state */
        false,  /* Hardware trigger 2 state */
        false,  /* Hardware trigger 3 state */
        false, /* Max loading point state */
        false, /* Min loading point state */
        FTM_SYSTEM_CLOCK, /* Update mode for INVCTRL register */
        FTM_SYSTEM_CLOCK, /* Update mode for SWOCTRL register */
        FTM_SYSTEM_CLOCK, /* Update mode for OUTMASK register */
        FTM_SYSTEM_CLOCK, /* Update mode for CNTIN register */
        false, /* Automatic clear of the trigger*/
        FTM_UPDATE_NOW, /* Synchronization point */
    },
        FTM_MODE_UP_TIMER, /* Mode of operation for FTM */
        FTM_CLOCK_DIVID_BY_1, /* FTM clock prescaler */
        FTM_CLOCK_SOURCE_SYSTEMCLK,   /* FTM clock source */
        FTM_BDM_MODE_11, /* FTM debug mode */
        true,    /* Interrupt state */
        false     /* Initialization trigger */
};

void FTM0_Ovf_Reload_IRQHandler(void)
{
    PINS_DRV_TogglePins(LED1_CTRL_GPIO, (1 &amp;lt;&amp;lt; LED1_CTRL_PIN));
    FTM_DRV_ClearStatusFlags(0, (uint32_t)FTM_TIME_OVER_FLOW_FLAG);
}


/* Timer mode configuration for flexTimer_mc_1 TimerConfig 0 */
ftm_timer_param_t flexTimer_mc_1_TimerConfig_0 =
{
        FTM_MODE_UP_TIMER, /* Counter mode */
        0, /* Initial counter value */
        3, //48000 /* Final counter value */
};


void run_demo_led(void){
	    /* Initialize FTM */
    FTM_DRV_Init(0, &amp;amp;flexTimer_mc_1_InitConfig_0, &amp;amp;ftm_state);

    /* Initialize counter */
    FTM_DRV_InitCounter(0, &amp;amp;flexTimer_mc_1_TimerConfig_0);

    /* Start Counter */
    FTM_DRV_CounterStart(0);
	
		while(1){
			
		}
}


{
        .clockName        = FTM0_CLK,
        .clkGate          = true,
        .clksrc=CLK_SRC_SPLL_DIV1, //CLK_SRC_SIRC_DIV1,
        .frac             = MULTIPLY_BY_ONE,
        .divider          = DIVIDE_BY_ONE,
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chandan_uv_3-1710826920278.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269084iC5A593E58472FE5B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chandan_uv_3-1710826920278.jpeg" alt="chandan_uv_3-1710826920278.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chandan_uv_0-1710826688006.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269081i1281113E17C9096C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chandan_uv_0-1710826688006.png" alt="chandan_uv_0-1710826688006.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chandan_uv_1-1710826707563.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269082i9073182F3610C37C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chandan_uv_1-1710826707563.png" alt="chandan_uv_1-1710826707563.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chandan_uv_2-1710826756393.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269083iD85B86093C72E7FF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chandan_uv_2-1710826756393.png" alt="chandan_uv_2-1710826756393.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 05:43:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Generate-Custom-pulse-with-S32K144/m-p/1830738#M33148</guid>
      <dc:creator>chandan_uv</dc:creator>
      <dc:date>2024-03-19T05:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Custom pulse with S32K144</title>
      <link>https://community.nxp.com/t5/S32K/Generate-Custom-pulse-with-S32K144/m-p/1833883#M33362</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/215611"&gt;@chandan_uv&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You can look into these documents for guidance on FTM usage:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN5303.pdf" target="_blank"&gt;AN5303: Features and Operation Modes of FlexTimer Module on S32K – Application Note&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN5413.pdf" target="_blank"&gt;AN5413: S32K1xx Series Cookbook – Application Note&lt;/A&gt;&amp;nbsp;(&lt;STRONG&gt;2.5 Timed I/O (FTM)&lt;/STRONG&gt;)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Julián&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 17:17:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Generate-Custom-pulse-with-S32K144/m-p/1833883#M33362</guid>
      <dc:creator>Julián_AragónM</dc:creator>
      <dc:date>2024-03-22T17:17:30Z</dc:date>
    </item>
  </channel>
</rss>

