<?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 library continuous change with softdevice not working</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10025/pwm-library-continuous-change-with-softdevice-not-working</link><description>Hi Guys, 
 once again, I have strange behavior of my code. 
 In my code I try in loop after ble_event received change PWM from 0 to 255 for my motor device. In debug logs, I can see continuous change value with 100ms delay (I tried also 500ms), but</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 15 Nov 2015 21:17:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10025/pwm-library-continuous-change-with-softdevice-not-working" /><item><title>RE: pwm library continuous change with softdevice not working</title><link>https://devzone.nordicsemi.com/thread/37158?ContentTypeID=1</link><pubDate>Sun, 15 Nov 2015 21:17:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39d55f16-716e-416e-9f85-8e9491ed04cd</guid><dc:creator>Vrabec</dc:creator><description>&lt;p&gt;@Paweł Zadrożniak, Finally, I incorporate scheduler into my application. Unfortunately, problem with Disconnect after some period of time remains. Updated workflow is following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;scheduler and my core functionality is initialized in main.&lt;/li&gt;
&lt;li&gt;When ble_event is received it&amp;#39;s dispatched to my service.&lt;/li&gt;
&lt;li&gt;Service checks send message (few bytes) it is propagated to HW.&lt;/li&gt;
&lt;li&gt;When PWM function is required, I start timer 1 (timer was already initialized)&lt;/li&gt;
&lt;li&gt;When timer IRQ happened, it schedules setting PWM value.&lt;/li&gt;
&lt;li&gt;In while loop (main), scheduler is executed.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In general program works, but when I set continuous changing PWM from duty cycle 0 to 255 with step 4, it takes about 20 iterations till BLE is disconnected. Do you have any idea how to solve this issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pwm library continuous change with softdevice not working</title><link>https://devzone.nordicsemi.com/thread/37157?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2015 14:49:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80f8c83f-08c8-425c-8852-3362c48f11ce</guid><dc:creator>Pawel Zadrozniak</dc:creator><description>&lt;p&gt;There was a lot of bugfixes and improvements, so I would recommend using app_pwm from SDK 10 anyway.
Note that app_pwm requires some time to change the duty cycle (up to 2 periods). To make a change when PWM is busy, you have to wait until the previous operation is complete. Waiting in interrupt (BLE event handler or timer handler) blocks the execution of lower/equal priority tasks. App_scheduler is a good option here - task can be queued in interrupt and executed in app_sched_execute() from main context.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pwm library continuous change with softdevice not working</title><link>https://devzone.nordicsemi.com/thread/37156?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2015 14:10:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0993d57f-6c8a-46a0-b5d6-8d06845fbff0</guid><dc:creator>Vrabec</dc:creator><description>&lt;p&gt;actually, I tried app_pwm from SDK 9 and issue remains. In forum I find out, that pwm was not able apply changes, because I did it all in ble event handling which has higher priority. So current version I have (still not working like I want) is following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;based on ble event (after parsing) i set some parameters for pwm.&lt;/li&gt;
&lt;li&gt;separate timer (initialized in main.c) check if this parameters was changed, and if yes, change pwm accordingly. Unfortunately with this approach I get ble disconnect event due general timeout. So far I don&amp;#39;t found/implement any solution. Maybe scheduler will do the trick, but I have no experience with this stuff.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pwm library continuous change with softdevice not working</title><link>https://devzone.nordicsemi.com/thread/37155?ContentTypeID=1</link><pubDate>Thu, 12 Nov 2015 14:02:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ebe6185-9105-4744-8d1b-dcc3b784b1a7</guid><dc:creator>Pawel Zadrozniak</dc:creator><description>&lt;p&gt;Have you tried the updated app_pwm library from SDK v10 ( &lt;a href="http://developer.nordicsemi.com/nRF51_SDK/"&gt;developer.nordicsemi.com/.../&lt;/a&gt; ) ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>