<?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>nrf51822 PWM with softdevice and ppi</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7014/nrf51822-pwm-with-softdevice-and-ppi</link><description>I am using nRF51822 to generate 3K HZ PWM signal for a buzzer.
I read other people&amp;#39;s question and try it.But as far i can&amp;#39;t solve this issue.Please help. 
 At first i use the simplest way,use for loop and delay.
Someone said that when softdevice enable</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 14 May 2015 05:52:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7014/nrf51822-pwm-with-softdevice-and-ppi" /><item><title>RE: nrf51822 PWM with softdevice and ppi</title><link>https://devzone.nordicsemi.com/thread/24747?ContentTypeID=1</link><pubDate>Thu, 14 May 2015 05:52:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6be8d74b-3cc5-4eb5-b6a7-e12c53a6917c</guid><dc:creator>YEN</dc:creator><description>&lt;p&gt;Thank you all. My  problem is solved.I use the Nordic pwm library.
One thing i want to notice other people is that,when the  project use softdevice it should notice the fuction we call,sometimes should use the function begin with nrf_ or sd_ .&lt;/p&gt;
&lt;p&gt;thank you     Krzysztof Chruściński and  RK. I learned a lot form this issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 PWM with softdevice and ppi</title><link>https://devzone.nordicsemi.com/thread/24746?ContentTypeID=1</link><pubDate>Wed, 13 May 2015 07:14:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af49e0b1-69c5-49d6-9224-f47bca168a94</guid><dc:creator>Krzysztof Chruscinski</dc:creator><description>&lt;p&gt;In SDK 8.1 we have added PWM driver. Take a look, it should solve your issues as it&amp;#39;s running freely using TIMER,PPI and GPIOTE. Also duty cycle change is done synchronously using PPI so won&amp;#39;t be affected by SoftDevice.&lt;/p&gt;
&lt;p&gt;Documentation:
&lt;a href="https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.1.0/s110/html/a00029.html"&gt;https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.1.0/s110/html/a00029.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;API Reference:
&lt;a href="https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.1.0/s110/html/a00983.html"&gt;https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.1.0/s110/html/a00983.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 PWM with softdevice and ppi</title><link>https://devzone.nordicsemi.com/thread/24745?ContentTypeID=1</link><pubDate>Wed, 13 May 2015 07:11:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee93b179-bb53-451e-8772-4cc5cffea7ff</guid><dc:creator>YEN</dc:creator><description>&lt;p&gt;Thank you for your answer.I made a try.Like your suggestion,set the ppi channels up to generate a waveform.SET CC[0], CC[1], CC[2].it comes a huge gaps between next wave.It needs to clear the timer.But Can PPI function  clear the timer?it only can connect to gpiote&amp;#39;s task?And i try to clear the timer in CC[3].CC[3]&amp;#39;s interrupt enabled, but it seems not going to the handler.Where i can&amp;#39;t understand is that,I only assigned event CC[O]~CC[2] to PPI[0]~PPI[2].Doesn&amp;#39;t assigned CC[3]&amp;#39;s event to any PPI function.Did i do something wrong that i don&amp;#39;t noticed?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 PWM with softdevice and ppi</title><link>https://devzone.nordicsemi.com/thread/24744?ContentTypeID=1</link><pubDate>Wed, 13 May 2015 02:59:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68770ebf-0ba6-4967-8e64-afe36097eebb</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;What you&amp;#39;re trying to do here isn&amp;#39;t going to work. Yes you are using PPI to actually toggle the pin to make each cycle of your waveform, which works independent of the softdevice, but you are relying on the TIMER2 interrupt to rewrite new values into the TIMER2 registers for the next part of the waveform after every toggle - which is just as bad as using the timer to generate the waveform in the first place. The softdevice is going to randomly delay timer interrupts for up to milliseconds at a time, so by the time your interrupt handler is called it may be many ticks later (I don&amp;#39;t know because I don&amp;#39;t know what your prescalar value is so I don&amp;#39;t know how long &amp;#39;40 ticks&amp;#39; is).&lt;/p&gt;
&lt;p&gt;I would assume looking at this code that you get huge gaps in the waveform where the timer has already counted past the value you want to set and possibly it&amp;#39;s even more random than that and CC[0], CC[1] and CC[2] get totally out of sync.&lt;/p&gt;
&lt;p&gt;You can&amp;#39;t get the kind of control you&amp;#39;re looking for here with the softdevice running, where you can change the timer values every time. You can set the ppi channels up to generate a certain frequency with a certain duty cycle, by having them clear the timer at the end of each cycle, you can change that cycle on an occasional basis, but that&amp;#39;s about the best you can do.&lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t help that you have your IRQ priority set to 3, but even if you set it to 1, the highest you&amp;#39;re allowed with the softdevice, you&amp;#39;re still going to have problems,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>