<?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>Enable pwm with button click</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8934/enable-pwm-with-button-click</link><description>I would like to start a pwm signal on PIN 15 while BUTTON_1 or BUTTON_2 is pressed. If BUTTON_1 or BUTTON_2 is released, than there should be no signal(low) on PIN 15. 
 Setup is: 
 -SoftDevice 8.0 
 -SDK 8.1 
 -nRF51DK 
 There is a related post</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Aug 2015 13:53:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8934/enable-pwm-with-button-click" /><item><title>RE: Enable pwm with button click</title><link>https://devzone.nordicsemi.com/thread/32884?ContentTypeID=1</link><pubDate>Thu, 27 Aug 2015 13:53:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cc6525a-a4c3-439f-8ed9-1a4325a0e3ad</guid><dc:creator>Inspectron</dc:creator><description>&lt;p&gt;@Aryan: Thank you for the support ;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enable pwm with button click</title><link>https://devzone.nordicsemi.com/thread/32883?ContentTypeID=1</link><pubDate>Thu, 27 Aug 2015 13:43:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9a6b67f-554b-4f1f-93be-e19e0d93bf53</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The problem is, if I comment out app_pwm_enable(&amp;amp;PWM1); in the PWMinit function then I
cannot connect to the board and the buttons are also not working.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;p&gt;The reason for this is that after you remove app_pwm_enable from PWMinit, you still have not commented out PWMDutySet in the next line. Since you are waiting for the ready_flag inside PWNDutySet, it will never return.&lt;/p&gt;
&lt;p&gt;I see that PWM_start is called not only from button_handler but also from adc_sampling_timeout_handler, auf_write_handler and ab_write_handler.
I commented it out in all except button handler and then i can turn on pwm using button1 and turn off using button2&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2577.Capture2.PNG" alt="image description" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>