<?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>i.MX ProcessorsのトピックRe: PWM problem</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/PWM-problem/m-p/257774#M24990</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is my source code:&lt;/P&gt;&lt;P&gt; writel(1&amp;lt;&amp;lt;20, HW_PINCTRL_MUXSEL7_SET); &lt;/P&gt;&lt;P&gt; writel(1&amp;lt;&amp;lt;21, HW_PINCTRL_MUXSEL7_CLR); &lt;/P&gt;&lt;P&gt; // Set the HW_PINCTRL_DRIVEx (3.3V, 12mA)&lt;/P&gt;&lt;P&gt; writel(0x00000600, HW_PINCTRL_DRIVE15_SET); &lt;/P&gt;&lt;P&gt; writel(1&amp;lt;&amp;lt;29 | 1 &amp;lt;&amp;lt;30, HW_CLKCTRL_XTAL_CLR); //gate clock for PWM&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Reset PWM module*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; writel(1&amp;lt;&amp;lt;31, HW_PWM_CTRL_CLR); //SFTRST = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Enable clock*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; //for(i = 100; i; i--);&lt;/P&gt;&lt;P&gt;&amp;nbsp; writel(1&amp;lt;&amp;lt;30, HW_PWM_CTRL_CLR); //CLKGATE = 0; &lt;/P&gt;&lt;P&gt;&amp;nbsp; writel(1&amp;lt;&amp;lt;7, HW_PWM_CTRL_CLR); //Disable PWM7&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; // Setup PWM channels&lt;/P&gt;&lt;P&gt;&amp;nbsp; writel(0x00002ee0, HW_PWM_ACTIVE7); //12000 ticks&lt;/P&gt;&lt;P&gt;&amp;nbsp; writel(0x000E5DBF, HW_PWM_PERIOD7); //24000 ticks&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; writel(1&amp;lt;&amp;lt;7, HW_PWM_CTRL_SET); //Enable PWM7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked the value of control and status register (all registers was set properly)&lt;/P&gt;&lt;P&gt;HW_CLKCTRL_XTAL: 00 00 00 01&lt;/P&gt;&lt;P&gt;HW_PWM_CTRL: 3F C0 00 80 (PWM7 is enabled)&lt;/P&gt;&lt;P&gt;HW_PWM_ACTIVE7: 00 00 2E E0&lt;/P&gt;&lt;P&gt;HW_PWM_PERIOD7: 00 0E 5D BF&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Apr 2013 13:47:38 GMT</pubDate>
    <dc:creator>thuanpham</dc:creator>
    <dc:date>2013-04-09T13:47:38Z</dc:date>
    <item>
      <title>PWM problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/PWM-problem/m-p/257773#M24989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to use PWM block of iMX286. I read the datasheet carefully and also read another thread at &lt;A _jive_internal="true" href="https://community.nxp.com/message/273292#273292" target="_blank"&gt;https://community.freescale.com/message/273292#273292&amp;nbsp; &lt;/A&gt; but it does not work yet.&lt;/P&gt;&lt;P&gt;My code did the following steps:&lt;/P&gt;&lt;P&gt;1. Setup HW_PINCTRL_MUXSELx register to enable PWM pin&lt;/P&gt;&lt;P&gt;2. Soft reset PWM block by clearing the two bits SFTRST and CLKGATE of HW_PW_CTRL register&lt;/P&gt;&lt;P&gt;3. Update value for the two registers HW_PWM_ACTIVEx and HW_PWM_PERIODx to set the period and duty cycle of output pulses&lt;/P&gt;&lt;P&gt;4. Enable PWM channel by setting bit in HW_PW_CTRL register&lt;/P&gt;&lt;P&gt;Could you let me know is there any wrong step?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 09:14:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/PWM-problem/m-p/257773#M24989</guid>
      <dc:creator>thuanpham</dc:creator>
      <dc:date>2013-04-09T09:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: PWM problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/PWM-problem/m-p/257774#M24990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is my source code:&lt;/P&gt;&lt;P&gt; writel(1&amp;lt;&amp;lt;20, HW_PINCTRL_MUXSEL7_SET); &lt;/P&gt;&lt;P&gt; writel(1&amp;lt;&amp;lt;21, HW_PINCTRL_MUXSEL7_CLR); &lt;/P&gt;&lt;P&gt; // Set the HW_PINCTRL_DRIVEx (3.3V, 12mA)&lt;/P&gt;&lt;P&gt; writel(0x00000600, HW_PINCTRL_DRIVE15_SET); &lt;/P&gt;&lt;P&gt; writel(1&amp;lt;&amp;lt;29 | 1 &amp;lt;&amp;lt;30, HW_CLKCTRL_XTAL_CLR); //gate clock for PWM&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Reset PWM module*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; writel(1&amp;lt;&amp;lt;31, HW_PWM_CTRL_CLR); //SFTRST = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Enable clock*/&lt;/P&gt;&lt;P&gt;&amp;nbsp; //for(i = 100; i; i--);&lt;/P&gt;&lt;P&gt;&amp;nbsp; writel(1&amp;lt;&amp;lt;30, HW_PWM_CTRL_CLR); //CLKGATE = 0; &lt;/P&gt;&lt;P&gt;&amp;nbsp; writel(1&amp;lt;&amp;lt;7, HW_PWM_CTRL_CLR); //Disable PWM7&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; // Setup PWM channels&lt;/P&gt;&lt;P&gt;&amp;nbsp; writel(0x00002ee0, HW_PWM_ACTIVE7); //12000 ticks&lt;/P&gt;&lt;P&gt;&amp;nbsp; writel(0x000E5DBF, HW_PWM_PERIOD7); //24000 ticks&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; writel(1&amp;lt;&amp;lt;7, HW_PWM_CTRL_SET); //Enable PWM7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked the value of control and status register (all registers was set properly)&lt;/P&gt;&lt;P&gt;HW_CLKCTRL_XTAL: 00 00 00 01&lt;/P&gt;&lt;P&gt;HW_PWM_CTRL: 3F C0 00 80 (PWM7 is enabled)&lt;/P&gt;&lt;P&gt;HW_PWM_ACTIVE7: 00 00 2E E0&lt;/P&gt;&lt;P&gt;HW_PWM_PERIOD7: 00 0E 5D BF&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 13:47:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/PWM-problem/m-p/257774#M24990</guid>
      <dc:creator>thuanpham</dc:creator>
      <dc:date>2013-04-09T13:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: PWM problem</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/PWM-problem/m-p/257775#M24991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I fixed the problem successfully by setting inactive period in HW_PWM_ACTIVEx register.&lt;/P&gt;&lt;P&gt;writel(0x4FFF2ee0, HW_PWM_ACTIVE7); //12000 ticks&lt;/P&gt;&lt;P&gt;The inactive period should be bigger than active period so the PWM block works as following description&lt;/P&gt;&lt;P&gt;1. The internal counter reset to 0 and start increasing&lt;/P&gt;&lt;P&gt;2. When the counter equal or greater than ACTIVE period, the PWM ouput change to Active state (HIGH level in my case)&lt;/P&gt;&lt;P&gt;3. When the counter equal or greater than INACTIVE period, the PWM output change to In-Active state (LOW level in my case)&lt;/P&gt;&lt;P&gt;The code works well.&lt;/P&gt;&lt;P&gt;Thuan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 02:01:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/PWM-problem/m-p/257775#M24991</guid>
      <dc:creator>thuanpham</dc:creator>
      <dc:date>2013-04-10T02:01:09Z</dc:date>
    </item>
  </channel>
</rss>

