<?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>Turn Off PWM</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48553/turn-off-pwm</link><description>Hi all 
 SDK 11.0.0 S132 version 2.0.1 nrf52832 
 I want to turn on the PWM and turn off the PWM after 1 minute. The device will do BLE advertising When the device wakeup from turn off state. So, I have written a function, pwm_on(), to turn on the PWM</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Jun 2019 14:20:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48553/turn-off-pwm" /><item><title>RE: Turn Off PWM</title><link>https://devzone.nordicsemi.com/thread/192746?ContentTypeID=1</link><pubDate>Thu, 13 Jun 2019 14:20:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f87baa66-f5d9-49fc-88b7-bfbac751037f</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;&lt;span&gt;if (NRF_PWM1-&amp;gt;TASKS_SEQSTART[0])&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;NRF_PWM1-&amp;gt;TASKS_STOP = 1;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This check will never be true, task registers are write-only.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Do this instead:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_PWM1-&amp;gt;TASKS_STOP = 1;
while(!NRF_PWM1-&amp;gt;EVENTS_STOPPED){};

NRF_PWM1-&amp;gt;PSEL.OUT[0]=(PWM_PSEL_OUT_CONNECT_Disconnected&amp;lt;&amp;lt;PWM_PSEL_OUT_CONNECT_Pos);
NRF_PWM1-&amp;gt;PSEL.OUT[1]=(PWM_PSEL_OUT_CONNECT_Disconnected&amp;lt;&amp;lt;PWM_PSEL_OUT_CONNECT_Pos);
NRF_PWM1-&amp;gt;PSEL.OUT[2]=(PWM_PSEL_OUT_CONNECT_Disconnected&amp;lt;&amp;lt;PWM_PSEL_OUT_CONNECT_Pos);
NRF_PWM1-&amp;gt;PSEL.OUT[3]=(PWM_PSEL_OUT_CONNECT_Disconnected&amp;lt;&amp;lt;PWM_PSEL_OUT_CONNECT_Pos);

NRF_PWM1-&amp;gt;ENABLE = (PWM_ENABLE_ENABLE_Disabled &amp;lt;&amp;lt; PWM_ENABLE_ENABLE_Pos);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>