<?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>app pwm nrf52</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16912/app-pwm-nrf52</link><description>Hi All, 
 I am attempting to use 6 PWM channels with the app_pwm library on the nRF52 and am only able to successfully get 4 pwm outputs. Upon changing the 6th channel (PWM2 below ch 0) the softdevice would disconnect. I was able to stop the disconnection</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Oct 2016 10:32:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16912/app-pwm-nrf52" /><item><title>RE: app pwm nrf52</title><link>https://devzone.nordicsemi.com/thread/64818?ContentTypeID=1</link><pubDate>Thu, 13 Oct 2016 10:32:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1694bd4b-e5c6-4773-ba53-0f7cba651a5c</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;I have not yet progressed on this towards SDK 11 or RTOS. I will postpone that further if you have adequate solution with the nrf_drv_pwm. Is the nrf_drv_pwm adequate for your scenario?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app pwm nrf52</title><link>https://devzone.nordicsemi.com/thread/64817?ContentTypeID=1</link><pubDate>Thu, 13 Oct 2016 01:20:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbe138db-49dc-4638-bdb1-ba0d841208de</guid><dc:creator>polarstate</dc:creator><description>&lt;p&gt;Shortly means approximately one second.&lt;/p&gt;
&lt;p&gt;How did your experiment with SDK 11 and FreeRTOS go? I moved to using the nrf_drv_pwm library and now have 6 channels working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app pwm nrf52</title><link>https://devzone.nordicsemi.com/thread/64816?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 16:57:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:042f5f62-976d-4d3e-9b67-7ad3575029d2</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;QFAAB0 is revision 1 nRF52 IC, so that should be fine.  What do you mean that it disconnects shortly after connection? Does &amp;quot;shortly&amp;quot; mean seconds or minutes?&lt;/p&gt;
&lt;p&gt;I have set up 6 pwm library channels with ble_app_hrs for SDK 12.1.0 and duty cycle update every 10ms. It seems to be working fine, i.e. I can connect and stay connected for a long time. I will try to reproduce this tomorrow with SDK 11 and RTOS&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app pwm nrf52</title><link>https://devzone.nordicsemi.com/thread/64815?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2016 17:02:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fcacfd4a-87e7-4d69-85ba-3ee7edf03ec4</guid><dc:creator>polarstate</dc:creator><description>&lt;p&gt;Thanks for your response Stefan.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;I am using SDK v11.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I believe I&amp;#39;m using v1.1 marking is QFAAB0&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On your suggestion I moved the while loops out of the main context but the same disconnection error persists.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I adapted the HRS + RTOS example to use the code from the PWM example.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I have also attempted to put the change in PWM in a different thread with lower priority and have the changes happen without input from the BLE characteristics. This causes the device to disconnect shortly after connection.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app pwm nrf52</title><link>https://devzone.nordicsemi.com/thread/64814?ContentTypeID=1</link><pubDate>Fri, 07 Oct 2016 11:24:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d91ea439-aba6-4a6b-bcfd-a39214ca2603</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;First thoughts: As I see it, you are setting PWM duty cycles in a BLE interrupt handler. You are busy waiting several times for the PWM callback. How long does that take? While you wait, you are blocking all other BLE callbacks. Try to put your code into main context instead, with e.g. using the scheduler. Another experiment could be to disable the CPU while you wait for the ready_flag, like&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;while(!ready_flag) { power_manage(); }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Are you adding the PWM to any standard SDK example? What SDK version is your code based on? Are you using &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52/dita/nrf52/compatibility_matrix/ic_revision_overview.html?cp=2_1_0"&gt;nRF52832 rev 1&lt;/a&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>