<?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: FTM counter Hardware trigger for PWM Sync at FTM0 on MKE18F in Other NXP Products</title>
    <link>https://community.nxp.com/t5/Other-NXP-Products/FTM-counter-Hardware-trigger-for-PWM-Sync-at-FTM0-on-MKE18F/m-p/1182611#M9853</link>
    <description>&lt;P&gt;Hi John, I hope you're doing well!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please try performing the modification for the hardware trigger by changing the sync mode using the FTM ftmInfo configuration structure in the simple_pwm SDK example to the corresponding hardware trigger being used?&lt;/P&gt;
&lt;P&gt;For example:&lt;BR /&gt;ftmInfo.pwmSyncMode = kFTM_HardwareTrigger_0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will configure the trigger and all of the corresponding configurations for the sync and syscon registers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Doing this in the SDK example project may be useful to show how to implement the same configurations on your baremetal project, the configurations for these registers can be seen in the fsl_ftm.c source file for the FTM driver in the SDK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This SDK project can be found in the following path of the SDK package:&lt;/P&gt;
&lt;P&gt;&amp;lt;…\SDK_2.8.0_TWR-KE18F\boards\twrke18f\driver_examples\ftm\simple_pwm&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know if you continue to have issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Sebastián&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2020 23:18:28 GMT</pubDate>
    <dc:creator>Sebastian_Del_Rio</dc:creator>
    <dc:date>2020-11-12T23:18:28Z</dc:date>
    <item>
      <title>FTM counter Hardware trigger for PWM Sync at FTM0 on MKE18F</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/FTM-counter-Hardware-trigger-for-PWM-Sync-at-FTM0-on-MKE18F/m-p/1179294#M9801</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I need to reset the PWM output channel at the Analog Comparator's rising edge&amp;nbsp;&lt;SPAN&gt;so I wrote the next code to set the PWM on FTM0 .&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SyncMode=1 for enhanced PWM Sync&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;HWRSTCNT =1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TRIG0 is enabled&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;HWTRIGMODE=1 in order not to clear TRIG0 to enable bit automatically at each sync event.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but the synchronization &lt;U&gt;didn't work at all&lt;/U&gt;. the CMP0 is working just fine and it is providing the rising edge to the FTM0 sync Input successfully&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;IFTM_PERIPHERAL-&amp;gt;MODE = FTM_MODE_WPDIS_MASK | FTM_MODE_FAULTM(2) | FTM_MODE_INIT_MASK |FTM_MODE_FTMEN_MASK;&lt;BR /&gt;&lt;BR /&gt;IFTM_PERIPHERAL-&amp;gt;CONF =FTM_CONF_BDMMODE(3);&lt;BR /&gt;IFTM_PERIPHERAL-&amp;gt;SYNCONF= FTM_SYNCONF_HWTRIGMODE_MASK | FTM_SYNCONF_HWRSTCNT_MASK | FTM_SYNCONF_SYNCMODE_MASK;//&lt;BR /&gt;&lt;BR /&gt;IFTM_PERIPHERAL-&amp;gt;SYNC = FTM_SYNC_CNTMIN_MASK |FTM_SYNC_TRIG0_MASK |FTM_SYNC_REINIT_MASK ;//&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;IFTM_PERIPHERAL-&amp;gt;COMBINE = FTM_COMBINE_COMBINE0_MASK | FTM_COMBINE_COMP0_MASK | FTM_COMBINE_DTEN0_MASK |&lt;BR /&gt;FTM_COMBINE_SYNCEN0_MASK | FTM_COMBINE_FAULTEN0_MASK | FTM_COMBINE_COMBINE1_MASK |&lt;BR /&gt;FTM_COMBINE_COMP1_MASK | FTM_COMBINE_DTEN1_MASK | FTM_COMBINE_SYNCEN1_MASK |&lt;BR /&gt;FTM_COMBINE_FAULTEN1_MASK ;&lt;/P&gt;&lt;P&gt;IFTM_PERIPHERAL-&amp;gt;CNTIN=(uint32_t)(-500);&lt;BR /&gt;IFTM_PERIPHERAL-&amp;gt;MOD=(uint32_t)(500);&lt;BR /&gt;IFTM_PERIPHERAL-&amp;gt;POL=0;&lt;BR /&gt;&lt;BR /&gt;IFTM_PERIPHERAL-&amp;gt;DEADTIME = FTM_DEADTIME_DTVAL(38) | FTM_DEADTIME_DTPS(1); // 38 =0.55usec OK on PC929&lt;/P&gt;&lt;P&gt;IFTM_PERIPHERAL-&amp;gt;CONTROLS[0].CnV=(uint32_t)(-400); IFTM_PERIPHERAL-&amp;gt;CONTROLS[1].CnV=(uint32_t)(400);&lt;/P&gt;&lt;P&gt;IFTM_PERIPHERAL-&amp;gt;CONTROLS[2].CnV=(uint32_t)(-200);IFTM_PERIPHERAL-&amp;gt;CONTROLS[3].CnV=(uint32_t)(200);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IFTM_PERIPHERAL-&amp;gt;CONTROLS[0].CnSC = FTM_CnSC_ELSB_MASK;&lt;BR /&gt;IFTM_PERIPHERAL-&amp;gt;CONTROLS[1].CnSC = FTM_CnSC_ELSB_MASK;&lt;BR /&gt;IFTM_PERIPHERAL-&amp;gt;CONTROLS[2].CnSC = FTM_CnSC_ELSB_MASK;&lt;BR /&gt;IFTM_PERIPHERAL-&amp;gt;CONTROLS[3].CnSC = FTM_CnSC_ELSB_MASK;&lt;BR /&gt;/* Set LOAD ok register */&lt;BR /&gt;/* enable loading updated values */&lt;BR /&gt;&lt;BR /&gt;IFTM_PERIPHERAL-&amp;gt;PWMLOAD = FTM_PWMLOAD_LDOK_MASK;&lt;/P&gt;&lt;P&gt;/* Initialization Trigger Enable */&lt;BR /&gt;IFTM_PERIPHERAL-&amp;gt;EXTTRIG = FTM_EXTTRIG_INITTRIGEN_MASK;&lt;/P&gt;&lt;P&gt;IFTM_PERIPHERAL-&amp;gt;FLTCTRL = FTM_FLTCTRL_FAULT3EN_MASK |FTM_FLTCTRL_FFLTR3EN_MASK |FTM_FLTCTRL_FFVAL(5) ;&lt;BR /&gt;IFTM_PERIPHERAL-&amp;gt;FLTPOL = FTM_FLTPOL_FLT1POL_MASK;&lt;BR /&gt;TRGMUX_SetTriggerSource(TRGMUX0, kTRGMUX_Ftm0, kTRGMUX_TriggerInput0, kTRGMUX_SourceCmp0Output);&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2020 08:30:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/FTM-counter-Hardware-trigger-for-PWM-Sync-at-FTM0-on-MKE18F/m-p/1179294#M9801</guid>
      <dc:creator>JohnEE</dc:creator>
      <dc:date>2020-11-06T08:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: FTM counter Hardware trigger for PWM Sync at FTM0 on MKE18F</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/FTM-counter-Hardware-trigger-for-PWM-Sync-at-FTM0-on-MKE18F/m-p/1182611#M9853</link>
      <description>&lt;P&gt;Hi John, I hope you're doing well!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please try performing the modification for the hardware trigger by changing the sync mode using the FTM ftmInfo configuration structure in the simple_pwm SDK example to the corresponding hardware trigger being used?&lt;/P&gt;
&lt;P&gt;For example:&lt;BR /&gt;ftmInfo.pwmSyncMode = kFTM_HardwareTrigger_0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will configure the trigger and all of the corresponding configurations for the sync and syscon registers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Doing this in the SDK example project may be useful to show how to implement the same configurations on your baremetal project, the configurations for these registers can be seen in the fsl_ftm.c source file for the FTM driver in the SDK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This SDK project can be found in the following path of the SDK package:&lt;/P&gt;
&lt;P&gt;&amp;lt;…\SDK_2.8.0_TWR-KE18F\boards\twrke18f\driver_examples\ftm\simple_pwm&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know if you continue to have issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Sebastián&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 23:18:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/FTM-counter-Hardware-trigger-for-PWM-Sync-at-FTM0-on-MKE18F/m-p/1182611#M9853</guid>
      <dc:creator>Sebastian_Del_Rio</dc:creator>
      <dc:date>2020-11-12T23:18:28Z</dc:date>
    </item>
  </channel>
</rss>

