<?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>Proper sequence to initialize PWM?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8210/proper-sequence-to-initialize-pwm</link><description>I&amp;#39;m having difficulty with using PWM library with softdevice. The app_pwm_init function returns 
 NRF_SUCCESS but call to app_pwm_enable does not generate an output. 
 //PWM sound generation
APP_PWM_INSTANCE(PWMpiezo,1);

void pwm_ready_callback</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Jul 2015 06:46:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8210/proper-sequence-to-initialize-pwm" /><item><title>RE: Proper sequence to initialize PWM?</title><link>https://devzone.nordicsemi.com/thread/29554?ContentTypeID=1</link><pubDate>Tue, 21 Jul 2015 06:46:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cedced66-ec89-4ad0-bc6f-a836b6d42b18</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;sometimes it helps to do a side by side comparision and sometimes it doesn&amp;#39;t. it is mostly timing with PWM so you need to compare the registers in the GPIOTE interrupt handler.
may be you can post your full main.c file here and we can have a look. Which version of SD and SDK are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper sequence to initialize PWM?</title><link>https://devzone.nordicsemi.com/thread/29553?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2015 15:23:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c75764c7-dc68-413b-bc7e-ef2a8f0624c3</guid><dc:creator>nszmnsky</dc:creator><description>&lt;p&gt;Sorry, meant to say I was writing down on paper what the register values were. I just did side by side comparison using screen grabs instead and am not seeing a difference in how the  GPIOTE, TIMER2 are set up. For GPIO the PIEZO pin settings are a match, and for PPI things match except for CHEN group which appears to get set to 0x80000000 during advertising start. Any value to posting these bitmaps?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper sequence to initialize PWM?</title><link>https://devzone.nordicsemi.com/thread/29552?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2015 14:33:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0e10da9-af77-48cb-be58-96a12a10fd95</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;No that is not a reliable way. Do not deviate your usage from what PWM recommended. Else it will become like what compiler standard says &amp;quot;ITS UNPREDICTABLE BEHAVIOR&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper sequence to initialize PWM?</title><link>https://devzone.nordicsemi.com/thread/29551?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2015 13:21:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0121b6b-d59b-4e69-9c05-3979f166b3cb</guid><dc:creator>nszmnsky</dc:creator><description>&lt;p&gt;Thanks for the update. However even moving pwm_init to end of main after all other inits doesn&amp;#39;t seem to work. I&amp;#39;ve been trying to check out peripheral register values between the PWM example (modified to match my settings) and my app. I&amp;#39;m looking at GPIO, GPIOTE, PPI, &amp;amp; TIMER2. So far I&amp;#39;m not seeing a difference but I&amp;#39;m doing it manually by writing values seen in the two apps so may not be reliable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper sequence to initialize PWM?</title><link>https://devzone.nordicsemi.com/thread/29550?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2015 07:34:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2204af03-4588-4bc4-9a98-68b25fccbb51</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;nszmnsky, This dependency is there. I missed to see it. Krzysztof agreed to investigate if it is needed and probably remove the dependency in the future. I think this case can rest until then as he knows most about it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper sequence to initialize PWM?</title><link>https://devzone.nordicsemi.com/thread/29549?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2015 06:58:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ca0150d-957a-4941-aa32-77b767e61e42</guid><dc:creator>Krzysztof Chruscinski</dc:creator><description>&lt;p&gt;It&amp;#39;s not mentioned in the documentation but PWM should be initialized after SoftDevice. The thing is that PWM is using PPI driver which if softdevice is present access PPI through softdevice. It&amp;#39;s recommended to initialize softdevice as one of the first things in the main().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper sequence to initialize PWM?</title><link>https://devzone.nordicsemi.com/thread/29548?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2015 21:58:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e1dcc7d-1a26-48e5-a22c-e5125df251fb</guid><dc:creator>nszmnsky</dc:creator><description>&lt;p&gt;The before ble_stack_init comment was in &amp;quot;&lt;a href="https://devzone.nordicsemi.com/question/23679/pwm-and-softdevice-on-nrf51822/"&gt;Pwm and softdevice on nRF5822&lt;/a&gt;&amp;quot; but on re-reading saw later comment from submitter that said after - after everything in fact. So is there a dependency/conflict that I&amp;#39;m not aware of?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper sequence to initialize PWM?</title><link>https://devzone.nordicsemi.com/thread/29547?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2015 14:24:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f34b150d-b41b-41dd-a4a7-9d47896300f0</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi nszmnsky&lt;/p&gt;
&lt;p&gt;Where does it say that it should be before ble_stack_init? I do not think that there is such dependency. you code works fine when i tried it here. Make sure you are sampling the right pin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>