<?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>S32KのトピックRe: FTM - Board compatibility / working</title>
    <link>https://community.nxp.com/t5/S32K/FTM-Board-compatibility-working/m-p/605303#M100</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was my missing Information :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;If external clock is selected as the FTM counter clock, &lt;STRONG&gt;then its freq must not exceed ¼ of the FTM system clock&lt;/STRONG&gt;.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thank you for Reply, it works the way&amp;nbsp;I want,&lt;/P&gt;&lt;P&gt;Nadreoh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Nov 2016 14:17:49 GMT</pubDate>
    <dc:creator>nadreoh</dc:creator>
    <dc:date>2016-11-03T14:17:49Z</dc:date>
    <item>
      <title>FTM - Board compatibility / working</title>
      <link>https://community.nxp.com/t5/S32K/FTM-Board-compatibility-working/m-p/605298#M95</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear support Team,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Context:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm trying to use my FlexTimer module on DevBoard RevB (S32K144).&lt;/P&gt;&lt;P&gt;I also have the datasheet from Aug. 2015 and the new one from Aug. 2016.&lt;/P&gt;&lt;P&gt;I work&amp;nbsp;with the&amp;nbsp;IAR IDE, using the IAR library and a J-LINK Debugger.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Is the FTM module able to work on my board (RevB)?&lt;/P&gt;&lt;P&gt;Or&amp;nbsp;should&amp;nbsp;I wait for&amp;nbsp;the new board (from 2016)?&lt;/P&gt;&lt;P&gt;Or&amp;nbsp;did&amp;nbsp;I missed one or more configurations in my Code?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note (from datasheet aug. 2015), page 801:&lt;/STRONG&gt; &lt;SPAN lang="JA" style="font-family: TimesLTStd-Roman; font-size: large;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The Global Load mechanism of FTM module is not supported on this device.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My configurations:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It seems to approximately work when trying to Flash Code after several times and using:&lt;/P&gt;&lt;P&gt;• SOSC at 8MHz&lt;/P&gt;&lt;P&gt;• SPLL at 32MHz, that is also the System clock source&amp;nbsp;(SYSclk/COREclk/BUSclk/SLOWclk set to 32MHz)&lt;/P&gt;&lt;P&gt;• SIRC / FIRC are disable&lt;/P&gt;&lt;P&gt;• FTM[0..3] clock source is SOSC_DIV1 (8MHz)&lt;/P&gt;&lt;P&gt;• PIN PTD15 / PTB5 set on Alteration2 to use FTM0_CH0 and FTM0_CH5 (same FTM0 Signal on this two PINs / channels)&lt;/P&gt;&lt;P&gt;• Need to generate a 4MHz PWM with Alpha, duty cycle&amp;nbsp;= 50%&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Code (only for FTM):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;Following the datasheet 2016 advice (page 1086) for my configuration. Uncalled Registers are&amp;nbsp;set as Default.&lt;/EM&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int main (void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;EM&gt;Disable WatchDog&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Oscillators initialization&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Ports initialization&lt;/EM&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Needs to set MOD to get only one incrementation */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;FTM0_MOD |= FTM_MOD_MOD(0x0001u);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Needs to set&amp;nbsp;Channels MODES to edge-aligned PWM&amp;nbsp;*/&lt;BR /&gt;&amp;nbsp; FTM0_C0SC |= FTM_C0SC_MSB(1u);&lt;BR /&gt;&amp;nbsp; FTM0_C0SC |= FTM_C0SC_ELSA(1u);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;FTM0_C5SC |= FTM_C5SC_MSB(1u);&lt;BR /&gt;&amp;nbsp; FTM0_C5SC |= FTM_C5SC_ELSA(1u);&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Needs to set&amp;nbsp;CnV to get flag&amp;nbsp;when Counter value is&amp;nbsp;1 */&lt;BR /&gt;&amp;nbsp; FTM0_C0V |= FTM_C0V_VAL(0x0001u);&lt;BR /&gt;&amp;nbsp; FTM0_C5V |= FTM_C5V_VAL(0x0001u);&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Others configurations... */&lt;BR /&gt;&amp;nbsp; FTM0_CNT |= FTM_CNT_COUNT(0x0000u);&lt;BR /&gt;&amp;nbsp; FTM0_SC |= FTM_SC_CLKS(3u);&lt;BR /&gt;&amp;nbsp; FTM0_SYNC |= FTM_SYNC_SYNCHOM(1u);&lt;BR /&gt;&amp;nbsp; FTM0_SYNCONF |= FTM_SYNCONF_SWOM(1u);&lt;BR /&gt;&amp;nbsp; FTM0_SYNCONF |= FTM_SYNCONF_SWRSTCNT(1u);&lt;BR /&gt;&amp;nbsp; FTM0_SYNCONF |= FTM_SYNCONF_SYNCMODE(1u) ;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;/* Enable FTM0_CH0 and FTM0_cH5 */&lt;BR /&gt;&amp;nbsp; FTM0_OUTMASK |= FTM_OUTMASK_CH7OM(1u);&lt;BR /&gt;&amp;nbsp; FTM0_OUTMASK |= FTM_OUTMASK_CH6OM(1u);&lt;BR /&gt;&amp;nbsp; FTM0_OUTMASK |= FTM_OUTMASK_CH5OM(0u);&lt;BR /&gt;&amp;nbsp; FTM0_OUTMASK |= FTM_OUTMASK_CH4OM(1u);&lt;BR /&gt;&amp;nbsp; FTM0_OUTMASK |= FTM_OUTMASK_CH3OM(1u);&lt;BR /&gt;&amp;nbsp; FTM0_OUTMASK |= FTM_OUTMASK_CH2OM(1u);&lt;BR /&gt;&amp;nbsp; FTM0_OUTMASK |= FTM_OUTMASK_CH1OM(1u);&lt;BR /&gt;&amp;nbsp; FTM0_OUTMASK |= FTM_OUTMASK_CH0OM(0u);&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Active matching channels */&lt;BR /&gt;&amp;nbsp; FTM0_SYNC |= FTM_SYNC_SWSYNC(1u);&lt;BR /&gt;&amp;nbsp; FTM0_SC |= FTM_SC_PWMEN0(1u);&lt;BR /&gt;&amp;nbsp; FTM0_SC |= FTM_SC_PWMEN5(1u);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Main Loop&lt;/EM&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Nadreoh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 10:56:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/FTM-Board-compatibility-working/m-p/605298#M95</guid>
      <dc:creator>nadreoh</dc:creator>
      <dc:date>2016-10-26T10:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: FTM - Board compatibility / working</title>
      <link>https://community.nxp.com/t5/S32K/FTM-Board-compatibility-working/m-p/605299#M96</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, the Global Load mechanism of FTM module is not supported on cut1 device (mask 0N77P).&lt;/P&gt;&lt;P&gt;The global load mechanism allows several FTM modules to have their double buffered registers synchronously reloaded after a synchronization event. In your code just FTM0 is used, so this feature is not needed.&lt;/P&gt;&lt;P&gt;The FTM should work. Or you do not see PWM waveform on the outputs?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR, Petr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2016 18:13:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/FTM-Board-compatibility-working/m-p/605299#M96</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2016-11-01T18:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: FTM - Board compatibility / working</title>
      <link>https://community.nxp.com/t5/S32K/FTM-Board-compatibility-working/m-p/605300#M97</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;Thank a lot for your answer.&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;I have tried some others configurations to understand how to generate PWM thanks to the FlexTimers, but it's not clear to me.&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;STRONG&gt;What I Need&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;I need an 8MHz PWM Signal coming from the FlexTimer0 with a&lt;SPAN style="color: #1f497d;"&gt; &lt;/SPAN&gt;50% duty cycle.&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;STRONG&gt;What I've done&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI style="margin: 0cm 0cm 0pt;"&gt;SOSC = 8MHz&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI style="margin: 0cm 0cm 0pt;"&gt;SPLL = 20 (MULT) * 8 SOSC / (2 (SPLL FACTOR) * 2 (DIV1) * (4 + 1 (PREDIV))&amp;nbsp; )&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;→ [16 MHz for SPLL] &amp;amp; [8 MHz for SPLLDIV1]&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="color: red;"&gt;NOTE : &lt;/SPAN&gt;it seems that the "+ 1" applied to the PreDivider is ignored on my board (Rev B). Is that a problem? I have to set PreDivider to 5 instead of 4 (+ 1).&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI style="margin: 0cm 0cm 0pt;"&gt;System clock is given by the SPLL clock : CORE = BUS = SLOW = SYS = 16MHz&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI style="margin: 0cm 0cm 0pt;"&gt;Using only FTM0 (same Code as above) on channel 0 (for the red LED) and channel 5 to output the signal on PIN PTB5.&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI style="margin: 0cm 0cm 0pt;"&gt;I refered to the illustration given in the attachment to configure FTM0 as PWM with a 50% duty cycle :&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin: 0cm 0cm 0pt; text-indent: 35.4pt;"&gt;FTM_MOD_MOD(0x0001u);&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; text-indent: 35.4pt;"&gt;FTM_C5V_VAL(0x0001u);&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; text-indent: 35.4pt;"&gt;FTM_SC_PS(0u);&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; text-indent: 35.4pt;"&gt;FTM0_CNTIN = 0x0000ul;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="PWM_on_FTM.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/6175iD2E436035BE96C8D/image-size/large?v=v2&amp;amp;px=999" role="button" title="PWM_on_FTM.PNG" alt="PWM_on_FTM.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;STRONG&gt;What I have&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;With the DIV1 set to "2", I got a PWM signal of 4MHz (8MHz from SPLLDIV1 is divided by 2 because the FTM needs one clock cycle to set up and one more to set down).&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;I tried to set the DIV1 to "1", but this time I didn't get any signal on FTM0. Why can't&lt;SPAN style="color: #1f497d;"&gt; I&lt;/SPAN&gt; set DIV1 to "1"? Are there any limits applied on FTM&lt;SPAN style="color: #1f497d;"&gt;,&lt;/SPAN&gt; system clock&lt;SPAN style="color: #1f497d;"&gt;,&lt;/SPAN&gt; PORTB or whatever?&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Nadreoh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 15:46:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/FTM-Board-compatibility-working/m-p/605300#M97</guid>
      <dc:creator>nadreoh</dc:creator>
      <dc:date>2016-11-02T15:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: FTM - Board compatibility / working</title>
      <link>https://community.nxp.com/t5/S32K/FTM-Board-compatibility-working/m-p/605301#M98</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;* The "+1" applied on PreDivider is coming from the configuration, this Problem is resolved. R&lt;SPAN lang="en"&gt;emains &lt;/SPAN&gt;the SPLLDIV1 Parameter problem...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 15:53:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/FTM-Board-compatibility-working/m-p/605301#M98</guid>
      <dc:creator>nadreoh</dc:creator>
      <dc:date>2016-11-02T15:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: FTM - Board compatibility / working</title>
      <link>https://community.nxp.com/t5/S32K/FTM-Board-compatibility-working/m-p/605302#M99</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nadreoh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If external clock is selected as the FTM counter clock, then its freq must not exceed ¼ of the FTM system clock.&lt;/P&gt;&lt;P&gt;Try to select FTM system clock as a counter clock, using FTM0_SC |= FTM_SC_CLKS(1u), and update PWM modulo according FTM system clock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR, Petr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 11:04:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/FTM-Board-compatibility-working/m-p/605302#M99</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2016-11-03T11:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: FTM - Board compatibility / working</title>
      <link>https://community.nxp.com/t5/S32K/FTM-Board-compatibility-working/m-p/605303#M100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was my missing Information :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;If external clock is selected as the FTM counter clock, &lt;STRONG&gt;then its freq must not exceed ¼ of the FTM system clock&lt;/STRONG&gt;.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thank you for Reply, it works the way&amp;nbsp;I want,&lt;/P&gt;&lt;P&gt;Nadreoh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 14:17:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/FTM-Board-compatibility-working/m-p/605303#M100</guid>
      <dc:creator>nadreoh</dc:creator>
      <dc:date>2016-11-03T14:17:49Z</dc:date>
    </item>
  </channel>
</rss>

