<?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: Fast Counter MK21FNM0VMD12 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fast-Counter-MK21FNM0VMD12/m-p/534969#M32960</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry not FTM1_MOD_A (PTC18). I mean FTM1_QD_PHA (PTA8)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Aug 2016 06:07:18 GMT</pubDate>
    <dc:creator>ralf1694</dc:creator>
    <dc:date>2016-08-18T06:07:18Z</dc:date>
    <item>
      <title>Fast Counter MK21FNM0VMD12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fast-Counter-MK21FNM0VMD12/m-p/534966#M32957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I implemented an VRZ for my K21 with PHA and PHB.&lt;/P&gt;&lt;P&gt;But now I need a counter, which counting up/down when PHA is high or on rising / falling edge. I have only one phase (PHA).&lt;/P&gt;&lt;P&gt;I sampled it with the quadrature mode, but I think this is the wrong way.&lt;/P&gt;&lt;P&gt;Is there an other solution, how I can use the PHA to increment/decrement my counter?&lt;/P&gt;&lt;P&gt;When I use the normal FTM up counting mode my counter counting but not in the mercy of my PHA?&lt;/P&gt;&lt;P&gt;Have anybody an idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds Oliver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2016 15:02:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fast-Counter-MK21FNM0VMD12/m-p/534966#M32957</guid>
      <dc:creator>ralf1694</dc:creator>
      <dc:date>2016-08-17T15:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Fast Counter MK21FNM0VMD12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fast-Counter-MK21FNM0VMD12/m-p/534967#M32958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Quadrature-mode requires interleaved edges on BOTH PHA and PHB to count -- the direction being defined by the interplay of 'high'/'low' 'rising'/falling' on both inputs.&amp;nbsp; Toggling just one input will simply make the counter go 'up' and 'down' 1 count on successive edges.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't explain further how you want to define whether you count 'up' or 'down' on any given edge of your 'clock'.&amp;nbsp; If you generally just want 'one way or the other' you simply select an external clock for the FTM in question and supply your signal to such external-clock-capable pin.&amp;nbsp; FTM will then count 'up' on one of 'rising' or 'falling' edges, and you can programmatically compute counts in an interval as 'one way or the other'.&amp;nbsp; If you want to supply a faster, externally-defined understanding of 'up' vs. 'down' you will have to build a bit of external hardware that will convert 'count &amp;amp; direction' into the 'PHA/PHB' sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will make rising-edges into quadrature:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Quadrature.GIF"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2331iEA493F281C385D56/image-size/large?v=v2&amp;amp;px=999" role="button" title="Quadrature.GIF" alt="Quadrature.GIF" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Direction control can be implemented by letting it control a pair of 2to1 muxes that select either these /Q, Q feedback points OR their inverse (Q, /Q) (or exclusive-or gates).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2016 16:48:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fast-Counter-MK21FNM0VMD12/m-p/534967#M32958</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2016-08-17T16:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Fast Counter MK21FNM0VMD12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fast-Counter-MK21FNM0VMD12/m-p/534968#M32959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Earl that was very helpful! If I want to select an external clock for my FTM counter and the counter direction should be in up counting mode.&lt;/P&gt;&lt;P&gt;The K21 has an FTM_CLKN0 (pin IN24) and FTM_CLKN1 (pin 25). Can I use other pins for my external clock for example the FTM1_MOD_A (PTC18)? And how I do it. I try to change it in the SIM-&amp;gt;SOPT4-&amp;gt;FTM1CLKSEL but it does not work. On the rising edge from my external clock my counter should count up but the counter is always 0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2016 05:52:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fast-Counter-MK21FNM0VMD12/m-p/534968#M32959</guid>
      <dc:creator>ralf1694</dc:creator>
      <dc:date>2016-08-18T05:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Fast Counter MK21FNM0VMD12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fast-Counter-MK21FNM0VMD12/m-p/534969#M32960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry not FTM1_MOD_A (PTC18). I mean FTM1_QD_PHA (PTA8)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2016 06:07:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fast-Counter-MK21FNM0VMD12/m-p/534969#M32960</guid>
      <dc:creator>ralf1694</dc:creator>
      <dc:date>2016-08-18T06:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Fast Counter MK21FNM0VMD12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fast-Counter-MK21FNM0VMD12/m-p/534970#M32961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not quite clear what part/package you are working with, but as you state the K21 family generally has two external FTM clock functions, that might be muxable (as ALT4) on either of PTA18/PTB16 and PTA19/PTB17.&amp;nbsp; As you note SOPT4 has a role in picking 'which one' is the external clock option, which you can then select as 0b11 in the CLKS field of FTMx_SC.&amp;nbsp; You will have to confirm pin function/mux options in the reference-manual for your particular chip, but 'where you can hook the clock' will be limited to those options.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2016 12:43:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fast-Counter-MK21FNM0VMD12/m-p/534970#M32961</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2016-08-18T12:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Fast Counter MK21FNM0VMD12</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fast-Counter-MK21FNM0VMD12/m-p/534971#M32962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2016 13:33:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Fast-Counter-MK21FNM0VMD12/m-p/534971#M32962</guid>
      <dc:creator>ralf1694</dc:creator>
      <dc:date>2016-08-18T13:33:13Z</dc:date>
    </item>
  </channel>
</rss>

