<?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: pwm changes randomly in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/pwm-changes-randomly/m-p/612688#M92506</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sajid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one can check if pwm is enabled in low power modes:&lt;/P&gt;&lt;P&gt;PWMx_PWMCR[WAITEN], DOZEN,STOPEN&lt;/P&gt;&lt;P&gt;and its clocks activity&amp;nbsp;CGR value in CCM_CCGR4 register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;BR /&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>Mon, 12 Sep 2016 23:59:58 GMT</pubDate>
    <dc:creator>igorpadykov</dc:creator>
    <dc:date>2016-09-12T23:59:58Z</dc:date>
    <item>
      <title>pwm changes randomly</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/pwm-changes-randomly/m-p/612687#M92505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a custom board based on imx6ul.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using PWM2 output on&amp;nbsp;ENET1_RX_DATA1.&lt;/P&gt;&lt;P&gt;When I set&amp;nbsp;&lt;/P&gt;&lt;P&gt;echo 0 &amp;gt;&amp;nbsp;&lt;SPAN&gt;/sys/class/pwm/pwmchip1/export&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;echo 1 &amp;gt;&amp;nbsp;/sys/class/pwm/pwmchip1/pwm0/enable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;echo 2500 &amp;gt; /sys/class/pwm/pwmchip1/pwm0/period&lt;/P&gt;&lt;P&gt;echo 1250 &amp;gt; /sys/class/pwm/pwmchip1/pwm0/duty_cycle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on the scope I see 100KHz at 50% duty cycle most of the time.&lt;/P&gt;&lt;P&gt;However, once every few seconds I&amp;nbsp;see bursts of 400KHz at 50% duty cycle&lt;/P&gt;&lt;P&gt;Can't figure out what's causing these random bursts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my device tree change imx6ul-14x14-evk.dts :&lt;/P&gt;&lt;P&gt;pinctrl_pwm2: pwm2grp {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;fsl,pins = &amp;lt;MX6UL_PAD_ENET1_RX_DATA1__PWM2_OUT 0x110b0&amp;gt;;&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;&amp;amp;pwm2 {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;pinctrl-names = "default";&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;pinctrl-0 = &amp;lt;&amp;amp;pinctrl_pwm2&amp;gt;;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;status = "okay";&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also made this change in arch/arm/boot/dts/imx6ul.dtsi&lt;/P&gt;&lt;P&gt;pwm2: pwm@02084000 {&lt;BR /&gt; compatible = "fsl,imx6ul-pwm", "fsl,imx27-pwm";&lt;BR /&gt; reg = &amp;lt;0x02084000 0x4000&amp;gt;;&lt;BR /&gt; interrupts = &amp;lt;GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH&amp;gt;;&lt;BR /&gt; clocks = &amp;lt;&amp;amp;clks IMX6UL_CLK_PWM2&amp;gt;,&lt;BR /&gt; &amp;lt;&amp;amp;clks IMX6UL_CLK_PWM2&amp;gt;;&lt;BR /&gt; clock-names = "ipg", "per";&lt;BR /&gt; #pwm-cells = &amp;lt;2&amp;gt;;&lt;BR /&gt; };&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2016 19:47:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/pwm-changes-randomly/m-p/612687#M92505</guid>
      <dc:creator>sajiddalvi</dc:creator>
      <dc:date>2016-09-12T19:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: pwm changes randomly</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/pwm-changes-randomly/m-p/612688#M92506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sajid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one can check if pwm is enabled in low power modes:&lt;/P&gt;&lt;P&gt;PWMx_PWMCR[WAITEN], DOZEN,STOPEN&lt;/P&gt;&lt;P&gt;and its clocks activity&amp;nbsp;CGR value in CCM_CCGR4 register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;BR /&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>Mon, 12 Sep 2016 23:59:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/pwm-changes-randomly/m-p/612688#M92506</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2016-09-12T23:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: pwm changes randomly</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/pwm-changes-randomly/m-p/612689#M92507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;Igor&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;Why would the clock go faster in low power modes?&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;BTW : I saw this same behavior on the scope when I monitored the backlight pwm1 output.&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;Also where would I check/set this register in code?&lt;/DIV&gt;&lt;DIV style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;I am currently relying on the stock pwm driver that comes with the imx6ul Evk.&lt;P&gt;&lt;/P&gt;Sajid&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 12:31:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/pwm-changes-randomly/m-p/612689#M92507</guid>
      <dc:creator>sajiddalvi</dc:creator>
      <dc:date>2016-09-13T12:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: pwm changes randomly</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/pwm-changes-randomly/m-p/612690#M92508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What BSP used in the case, is it official NXP BSP from&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/i.mx-applications-processors/i.mx-6-processors/i.mx6qp/i.mx-6-series-software-and-development-tool-resources:IMX6_SW" title="http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/i.mx-applications-processors/i.mx-6-processors/i.mx6qp/i.mx-6-series-software-and-development-tool-resources:IMX6_SW"&gt;i.MX 6 Series Software and Development Tool|NXP&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One can check pwm source clock in PWMx_PWMCR[CLKSRC]&lt;/P&gt;&lt;P&gt;and output it using CCM_CCOSR register, check it with oscilloscope.&lt;/P&gt;&lt;P&gt;Some processor clocks may be changed due to CPU Freq governor,&lt;/P&gt;&lt;P&gt;one can try to change it to Performance and check if issue will persist&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/429536"&gt;why the system work at ondemand?&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~igor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 00:08:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/pwm-changes-randomly/m-p/612690#M92508</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2016-09-14T00:08:38Z</dc:date>
    </item>
  </channel>
</rss>

