<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>PWM sleep</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95114/pwm-sleep</link><description>Hi, I&amp;#39;ve noticed much higher than expected power usage and I&amp;#39;ve narrowed it down to PWM. I need to be able to turn off the PWMs when they&amp;#39;re not needed. 
 
 I use all 4 PWMs (PWM0, PWM1, PWM2, PWM3) 
 I use this code to turn them off. 
 
 Here is my test</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 23 Dec 2022 13:31:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95114/pwm-sleep" /><item><title>RE: PWM sleep</title><link>https://devzone.nordicsemi.com/thread/402090?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2022 13:31:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2508c391-90eb-4b7d-9913-c19eaa924cdf</guid><dc:creator>Jason</dc:creator><description>&lt;p&gt;Hi Jared, yes, current decreases if I turn off PWM, I get 3uA.&lt;/p&gt;
&lt;p&gt;But when my product runs it always shows at least one LED, so I cannot turn off the PWM.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve just found the low_power_pwm library! THANK YOU!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Merry Christmas &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM sleep</title><link>https://devzone.nordicsemi.com/thread/402086?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2022 13:24:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:deddc9ab-fc34-43d2-99a2-8eea99f90e43</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;800 µA is the HFCLK that is started once the PWM peripheral is enabled which is as expected. Does the current decrease once you disable the peripheral? In the nRF5SDK we had a library that bit-banged PWM and used the RTC instead of the HFCLK to decrease the current consumption. We have yet to develop such a driver for the Zephyr RTOS, but you can find the low power pwm driver in nRF5SDK if you would like to try it yourself. Lastly, I totally agree that we should have an electrical section for the PWM peripheral just as we have for other peripherals.&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM sleep</title><link>https://devzone.nordicsemi.com/thread/402055?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2022 09:49:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89ca7f18-3f81-437c-bb23-acd3759c7e44</guid><dc:creator>Jason</dc:creator><description>&lt;p&gt;If you can help me with this then that would be great, I&amp;#39;ve tested the power usage with only 1 PWM enabled and it&amp;#39;s still the same 800uA figure.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Almost all the time I simply need to illuminate a single LED, dimmed to around 5% or 50%. I don&amp;#39;t need a sequence, just a constant. Is there any way to use less power?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the 50% case I considered trying to coerce the clock from the TWI or SPI peripherals to give me the 50% dimming, but that doesn&amp;#39;t help me with the 5% case.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I read somewhere that the PWM uses less power if it uses the 125khz clock, but I can&amp;#39;t see any way to change the base clock.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM sleep</title><link>https://devzone.nordicsemi.com/thread/402007?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2022 19:42:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b190ff8-acf3-49d5-9f43-44413562d878</guid><dc:creator>Jason</dc:creator><description>&lt;p&gt;Ok, I am not sure what I changed, but this is now working as expected! Very strange.&lt;/p&gt;
&lt;p&gt;I changed my pwm_init to&amp;nbsp;use&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class="ui-code" data-mode="text"&gt;&amp;#160; &amp;#160; NRF_PWM0-&amp;gt;ENABLE = (PWM_ENABLE_ENABLE_Disabled &amp;lt;&amp;lt; PWM_ENABLE_ENABLE_Pos);
&amp;#160; &amp;#160; NRF_PWM1-&amp;gt;ENABLE = (PWM_ENABLE_ENABLE_Disabled &amp;lt;&amp;lt; PWM_ENABLE_ENABLE_Pos);
&amp;#160; &amp;#160; NRF_PWM2-&amp;gt;ENABLE = (PWM_ENABLE_ENABLE_Disabled &amp;lt;&amp;lt; PWM_ENABLE_ENABLE_Pos);
&amp;#160; &amp;#160; NRF_PWM3-&amp;gt;ENABLE = (PWM_ENABLE_ENABLE_Disabled &amp;lt;&amp;lt; PWM_ENABLE_ENABLE_Pos);&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;prior to setting up PWM0, PWM1, PWM2 and PWM3.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;and then after they&amp;#39;re set up, I use this code to start them.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;pre class="ui-code" data-mode="text"&gt;    NRF_PWM0-&amp;gt;ENABLE = (PWM_ENABLE_ENABLE_Enabled &amp;lt;&amp;lt; PWM_ENABLE_ENABLE_Pos);
    NRF_PWM1-&amp;gt;ENABLE = (PWM_ENABLE_ENABLE_Enabled &amp;lt;&amp;lt; PWM_ENABLE_ENABLE_Pos);
    NRF_PWM2-&amp;gt;ENABLE = (PWM_ENABLE_ENABLE_Enabled &amp;lt;&amp;lt; PWM_ENABLE_ENABLE_Pos);
    NRF_PWM3-&amp;gt;ENABLE = (PWM_ENABLE_ENABLE_Enabled &amp;lt;&amp;lt; PWM_ENABLE_ENABLE_Pos);


    NRF_PWM0-&amp;gt;TASKS_SEQSTART[0] = PWM_TASKS_SEQSTART_TASKS_SEQSTART_Trigger &amp;lt;&amp;lt; PWM_TASKS_SEQSTART_TASKS_SEQSTART_Pos;
    NRF_PWM1-&amp;gt;TASKS_SEQSTART[0] = PWM_TASKS_SEQSTART_TASKS_SEQSTART_Trigger &amp;lt;&amp;lt; PWM_TASKS_SEQSTART_TASKS_SEQSTART_Pos;
    NRF_PWM2-&amp;gt;TASKS_SEQSTART[0] = PWM_TASKS_SEQSTART_TASKS_SEQSTART_Trigger &amp;lt;&amp;lt; PWM_TASKS_SEQSTART_TASKS_SEQSTART_Pos;
    NRF_PWM3-&amp;gt;TASKS_SEQSTART[0] = PWM_TASKS_SEQSTART_TASKS_SEQSTART_Trigger &amp;lt;&amp;lt; PWM_TASKS_SEQSTART_TASKS_SEQSTART_Pos;
&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;I then use the code I posted earlier to stop them again, and I get back to 3uA sleep current.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;I&amp;#39;ve had intermittent problems flashing boards in NCS, it appears to upload the new firmware, but then the changes aren&amp;#39;t present.&lt;/div&gt;
&lt;div&gt;And if I run it with the debugger then it fixes it. I&amp;#39;m not sure why there would be a difference. Maybe a different flash procedure.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;I also find that if I use the debugger then sometimes later I can&amp;#39;t reset my board. The only way to continue is to use the debugger, or use &amp;quot;recover board&amp;quot; to get it back.&lt;/div&gt;
&lt;p&gt;Maybe this happened earlier. I&amp;#39;m not sure.&lt;/p&gt;
&lt;p&gt;But anyway, RIGHT NOW, it&amp;#39;s working &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Glaedlig Jul!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM sleep</title><link>https://devzone.nordicsemi.com/thread/401972?ContentTypeID=1</link><pubDate>Thu, 22 Dec 2022 14:34:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f794f6ad-0b21-46a0-8fbe-fcf82d4495c0</guid><dc:creator>Jason</dc:creator><description>&lt;p&gt;Also, is there an electrical specification for PWM? I can&amp;#39;t find one in the 52833 product spec. I&amp;#39;m not sure what current I should expect or how to reduce it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I seem to see around 800uA of current just from enabling PWM, without even illuminating any leds (zero duty cycle). I anticipated it would be&amp;nbsp;a few uA&amp;#39;s so it would be nice to reduce this.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m especially interested in reducing the current when only 1 pin is connected. Most of the time I just need it to dim a single LED. I don&amp;#39;t need fine control of the brightness.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your help, as always &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>