<?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>8-bit MicrocontrollersのトピックRe: PWM doesn't work</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-doesn-t-work/m-p/215095#M18634</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure whether you already found your problem.&amp;nbsp; The TPM module has a coherency mechanism that requires that both high and low bytes be written to TPM2C0V before the register becomes updated with the new value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TPM2C0V = 10;&amp;nbsp; // This should update both high and low bytes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The TPM2MOD value in the example will give a period of 257 TPM clock cycles for overflow.&amp;nbsp; If you actually require a PWM period of 256 clock cycles, you should use the setting:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TPM2MOD = 255;&amp;nbsp; // This gives TPM overflow period of 256 cycles&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Jul 2010 14:55:37 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2010-07-28T14:55:37Z</dc:date>
    <item>
      <title>PWM doesn't work</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-doesn-t-work/m-p/215092#M18631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I am having trouble with PWM&amp;nbsp; @ AW16 CPU. Device is selfcloked, 20MHz BUS. I am having following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM2SC =0b00001000;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM2MOD=256;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM2C0SC=0b00010100;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM2C0VL=10;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, edge aligned high pulse PWM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This doens't produce and output at TPM2CH0 pin. Pin is log0 for all the time. TPM2 is running properly (TPM2CNT cycles 0-255).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I change channel mode to TPM2C0SC=0b00010110; which is low pulses, pin is logic zero and after first cycles goes to high and keeps high.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I change mode to TPM2C0SC=0b00010100; which is toggle output on compare, pin in CPU starts doing PWM as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am doing wrong ? Why PWN doesn't work and toggle on compare works ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jul 2010 16:39:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-doesn-t-work/m-p/215092#M18631</guid>
      <dc:creator>Pivson</dc:creator>
      <dc:date>2010-07-27T16:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: PWM doesn't work</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-doesn-t-work/m-p/215093#M18632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, there was typo, it should be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM2SC =0b00001000;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM2MOD=256;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM2C0SC=0b00101000;&amp;nbsp; //&amp;nbsp; (MSnB:MSnA ELSnB:ELSnA=10 10)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TPM2C0VL=10;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jul 2010 21:19:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-doesn-t-work/m-p/215093#M18632</guid>
      <dc:creator>Pivson</dc:creator>
      <dc:date>2010-07-27T21:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: PWM doesn't work</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-doesn-t-work/m-p/215094#M18633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a typo, I am addressing just L byte of 16bit compare value. That's all &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jul 2010 12:28:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-doesn-t-work/m-p/215094#M18633</guid>
      <dc:creator>Pivson</dc:creator>
      <dc:date>2010-07-28T12:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: PWM doesn't work</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-doesn-t-work/m-p/215095#M18634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure whether you already found your problem.&amp;nbsp; The TPM module has a coherency mechanism that requires that both high and low bytes be written to TPM2C0V before the register becomes updated with the new value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TPM2C0V = 10;&amp;nbsp; // This should update both high and low bytes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The TPM2MOD value in the example will give a period of 257 TPM clock cycles for overflow.&amp;nbsp; If you actually require a PWM period of 256 clock cycles, you should use the setting:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TPM2MOD = 255;&amp;nbsp; // This gives TPM overflow period of 256 cycles&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jul 2010 14:55:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-doesn-t-work/m-p/215095#M18634</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-07-28T14:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: PWM doesn't work</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-doesn-t-work/m-p/215096#M18635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It was the problem. I didn't saw, it's 16bit register...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you ! &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jul 2010 15:02:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-doesn-t-work/m-p/215096#M18635</guid>
      <dc:creator>Pivson</dc:creator>
      <dc:date>2010-07-28T15:02:54Z</dc:date>
    </item>
  </channel>
</rss>

