<?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 Microcontrollers中的主题 Re: Triggering TPM0 Start on CMP0 MKL27Z32</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Triggering-TPM0-Start-on-CMP0-MKL27Z32/m-p/779567#M47431</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;Carl,&lt;/P&gt;&lt;P&gt;Please try to use the code shown below:&lt;/P&gt;&lt;P&gt;TimerConf.triggerSelect = kTPM_Trigger_Select_1;&lt;BR /&gt;TimerConf.triggerSource = kTPM_TriggerSource_External;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="external trigger options.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/13869i5EA3A72789D659E1/image-size/large?v=v2&amp;amp;px=999" role="button" title="external trigger options.jpg" alt="external trigger options.jpg" /&gt;&lt;/span&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;Robin&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Jan 2018 08:22:00 GMT</pubDate>
    <dc:creator>Robin_Shen</dc:creator>
    <dc:date>2018-01-17T08:22:00Z</dc:date>
    <item>
      <title>Triggering TPM0 Start on CMP0 MKL27Z32</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Triggering-TPM0-Start-on-CMP0-MKL27Z32/m-p/779566#M47430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using TPM0 to generate a PWM on a pin, I want the the CMP0 Output to trigger the start/restart of the PWM output. To produce a timed pulse based upon the specified duty cycle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've set the PWM to Stop on overflow and start on trigger, set the trigger to 1, which the KL27 Sub-Family Reference Manual page 335 says is the CMP0 output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;TPM_GetDefaultConfig(&amp;amp;TimerConf);
TimerConf.enableStopOnOverflow = true;
TimerConf.enableStartOnTrigger = true;

&lt;SPAN&gt;TimerConf&lt;/SPAN&gt;.triggerSelect = kTPM_Trigger_Select_1;
&lt;SPAN&gt;TimerConf&lt;/SPAN&gt;.triggerSource = kTPM_TriggerSource_Internal;

TPM_Init(TPM0, &amp;amp;&lt;SPAN&gt;TimerConf&lt;/SPAN&gt;);

But the timer doesn't get restarted by the CMP0 trigger, 
I know the CMP0 is firing as I see it's interrupt occurring.

If I change the TPM0 trigger source to use an external pin :
&lt;PRE&gt;&lt;P&gt;&lt;SPAN&gt;TimerConf&lt;/SPAN&gt;.triggerSelect = kTPM_Trigger_Select_0;&lt;/P&gt;&lt;P&gt;TimerConf.triggerSource = kTPM_TriggerSource_External;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works and the PWM counter gets reset and the TPM is started. &lt;/P&gt;&lt;P&gt;I need to use the CMP to trigger the timer though as the input has noise and it want to use its filtering abilities.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Advice?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another question, if I can't get the above to work, how do you restart a timer that has stopped when using &lt;/P&gt;&lt;P&gt;enableStopOnOverflow. I could do this from the functioning CMP0 interrupt then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jan 2018 22:46:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Triggering-TPM0-Start-on-CMP0-MKL27Z32/m-p/779566#M47430</guid>
      <dc:creator>carl-circuitwor</dc:creator>
      <dc:date>2018-01-10T22:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering TPM0 Start on CMP0 MKL27Z32</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Triggering-TPM0-Start-on-CMP0-MKL27Z32/m-p/779567#M47431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;Carl,&lt;/P&gt;&lt;P&gt;Please try to use the code shown below:&lt;/P&gt;&lt;P&gt;TimerConf.triggerSelect = kTPM_Trigger_Select_1;&lt;BR /&gt;TimerConf.triggerSource = kTPM_TriggerSource_External;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="external trigger options.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/13869i5EA3A72789D659E1/image-size/large?v=v2&amp;amp;px=999" role="button" title="external trigger options.jpg" alt="external trigger options.jpg" /&gt;&lt;/span&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;Robin&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jan 2018 08:22:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Triggering-TPM0-Start-on-CMP0-MKL27Z32/m-p/779567#M47431</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2018-01-17T08:22:00Z</dc:date>
    </item>
  </channel>
</rss>

