<?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>S12 / MagniV Microcontrollers中的主题 Re: PWM - phase shifting mc9s12xdp512</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-phase-shifting-mc9s12xdp512/m-p/649024#M13761</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;BR /&gt;Any value written to the PWMCNTx register causes PWM counter to be reset.&lt;/P&gt;&lt;P&gt;The only solution is to trigger the PWM channels by software with certain delay.&lt;/P&gt;&lt;P&gt;Although there is always certain latency, it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="PWM_shift.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/12785i1B6402919264B305/image-size/large?v=v2&amp;amp;px=999" role="button" title="PWM_shift.png" alt="PWM_shift.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For instance, the example above shows four left-aligned PWM signals, where&lt;/P&gt;&lt;P&gt;PWM0: Used only for generating delay.&lt;BR /&gt;PWM1: Original signal&lt;BR /&gt;PWM2: shifted (90 degree), enabled on falling edge of PWM0&lt;BR /&gt;PWM3: shifted (180 degree), enabled on rising edge of PWM0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PWM0 and 1 are enabled from main function at the same time. The other two signals are triggered from ISR.&lt;/P&gt;&lt;P&gt;Pins P6 and P7 are set for pin event detection and connected to PWM0 (Pin P0).&lt;/P&gt;&lt;P&gt;When falling (P7) or rising (P6) edge is detected, the ISR enables other PWM. &lt;/P&gt;&lt;P&gt;Therefore, the phase shift is determined by the duty cycle and the period of PMW0.&lt;/P&gt;&lt;P&gt;Once all shifted PWM are enabled, PWM0 may be disabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the project attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jan 2017 16:12:46 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2017-01-30T16:12:46Z</dc:date>
    <item>
      <title>PWM - phase shifting mc9s12xdp512</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-phase-shifting-mc9s12xdp512/m-p/649023#M13760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking to create a phase shift of 90 degrees on two, possibly three PWM channels with a 10% duty cycle. &amp;nbsp;Can I set PWNCNTx channels in a way to accomplish this? &amp;nbsp;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2017 06:37:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-phase-shifting-mc9s12xdp512/m-p/649023#M13760</guid>
      <dc:creator>kenung</dc:creator>
      <dc:date>2017-01-27T06:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: PWM - phase shifting mc9s12xdp512</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-phase-shifting-mc9s12xdp512/m-p/649024#M13761</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;BR /&gt;Any value written to the PWMCNTx register causes PWM counter to be reset.&lt;/P&gt;&lt;P&gt;The only solution is to trigger the PWM channels by software with certain delay.&lt;/P&gt;&lt;P&gt;Although there is always certain latency, it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="PWM_shift.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/12785i1B6402919264B305/image-size/large?v=v2&amp;amp;px=999" role="button" title="PWM_shift.png" alt="PWM_shift.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For instance, the example above shows four left-aligned PWM signals, where&lt;/P&gt;&lt;P&gt;PWM0: Used only for generating delay.&lt;BR /&gt;PWM1: Original signal&lt;BR /&gt;PWM2: shifted (90 degree), enabled on falling edge of PWM0&lt;BR /&gt;PWM3: shifted (180 degree), enabled on rising edge of PWM0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PWM0 and 1 are enabled from main function at the same time. The other two signals are triggered from ISR.&lt;/P&gt;&lt;P&gt;Pins P6 and P7 are set for pin event detection and connected to PWM0 (Pin P0).&lt;/P&gt;&lt;P&gt;When falling (P7) or rising (P6) edge is detected, the ISR enables other PWM. &lt;/P&gt;&lt;P&gt;Therefore, the phase shift is determined by the duty cycle and the period of PMW0.&lt;/P&gt;&lt;P&gt;Once all shifted PWM are enabled, PWM0 may be disabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the project attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2017 16:12:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-phase-shifting-mc9s12xdp512/m-p/649024#M13761</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2017-01-30T16:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: PWM - phase shifting mc9s12xdp512</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-phase-shifting-mc9s12xdp512/m-p/649025#M13762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;The only solution is to trigger the PWM channels by software with certain delay.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not only. PWMCNT indeed helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PWMPER1 = targetperiod;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PWME = (1&amp;lt;&amp;lt;0)|(1&amp;lt;&amp;lt;1); // enable channels 0 and 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PWMPER0 = targetperiod/2u; // 180 deg phase shift&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;disable_interrupts();&amp;nbsp; // prevent interrupt&amp;nbsp;/ taskswitching between next two lines&lt;/P&gt;&lt;P&gt;PWMCNT01 = 0; // reset counters 0 and 1, immediately apply period, duty, polarity etc&lt;/P&gt;&lt;P&gt;PWMPER0 = targetperiod; // Since PWMPER is double buffered, period will&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // restore to full targetperiod&amp;nbsp;at the end of current targetperiod/2 !&lt;/P&gt;&lt;P&gt;enable_interrupts();&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 11:22:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-phase-shifting-mc9s12xdp512/m-p/649025#M13762</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2017-01-31T11:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: PWM - phase shifting mc9s12xdp512</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-phase-shifting-mc9s12xdp512/m-p/649026#M13763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Edward&lt;/P&gt;&lt;P&gt;You are right, this is much better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2017 12:31:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-phase-shifting-mc9s12xdp512/m-p/649026#M13763</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2017-01-31T12:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: PWM - phase shifting mc9s12xdp512</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-phase-shifting-mc9s12xdp512/m-p/649027#M13764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I do not know how complex system you will drive but have you thought about XGATE and PIT channels. I believe it will provide you more variability to create signals. Moreover, if you do not use XGATE for anything more it is not affected by CPU interrupts as well as it does not affects CPU code.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ladislav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Feb 2017 08:29:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-phase-shifting-mc9s12xdp512/m-p/649027#M13764</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2017-02-01T08:29:25Z</dc:date>
    </item>
  </channel>
</rss>

