<?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 on 3 pins</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24047/pwm-on-3-pins</link><description>I have a nrf51 dongle and would like to use PWM on 3 pins.
Managed to get it working on pins 15 and 16, but somehow pins from 17 to 20 just don&amp;#39;t work.
For example: I set an LED on pin 17 and when using PWM it turns on and immediately off. 
 To use</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Aug 2017 14:49:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24047/pwm-on-3-pins" /><item><title>RE: PWM on 3 pins</title><link>https://devzone.nordicsemi.com/thread/94677?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 14:49:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42e91858-32a8-4f6a-91f9-6534642de6d1</guid><dc:creator>bojerko</dc:creator><description>&lt;p&gt;On BLE_Characteristic and yes. The buttons setup was a problem for 17 - 20 not working. I resolved that. And the other problem was that I was setting the pwm in ble_write. I moved the setup code to our_char_add function and it works now.&lt;/p&gt;
&lt;p&gt;Thanks :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM on 3 pins</title><link>https://devzone.nordicsemi.com/thread/94676?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 14:42:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c77dea2-827b-468d-a1fa-5766d40e96b0</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;What example did you base your code on? Note that pin 17-20 is used for the buttons on the nRF51-DK (PCA10028), so many examples will configure these pins for the buttons. If you are working on the nRF51-Dongle, it is important to set the &lt;code&gt;BOARD_PCA10031&lt;/code&gt; in the pre-processor symbol list, and remove the &lt;code&gt;BOARD_PCA10028&lt;/code&gt; define.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM on 3 pins</title><link>https://devzone.nordicsemi.com/thread/94681?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 13:52:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13e57b7b-b487-4a8a-9075-31c97489006d</guid><dc:creator>bojerko</dc:creator><description>&lt;p&gt;OK. Thanks. I&amp;#39;ll check it. I&amp;#39;m working on mac, so no error handling :/&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM on 3 pins</title><link>https://devzone.nordicsemi.com/thread/94680?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 13:27:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b1f7106-174f-4558-a153-9c1e81c7f8ac</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;You can use up-to 4 PWM channels together with the SoftDevice(BLE) without problems. There is also an full example of this in &lt;a href="https://devzone.nordicsemi.com/question/62942/buzzer-beep-in-immediate-alert-service/?answer=63450#post-id-63450"&gt;this post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Are you running into the error handler when you enable both PWM1 and PWM2 ? See &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/"&gt;this post&lt;/a&gt; about debugging.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM on 3 pins</title><link>https://devzone.nordicsemi.com/thread/94679?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 12:30:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca9986c1-7b13-48eb-84c5-7cf2a507871c</guid><dc:creator>bojerko</dc:creator><description>&lt;p&gt;I wonder if the reason that I use the procedure in BLE is a reason for PWM2 and PWM1 not working together. If I use only PWM2 and comment out PWM1 it works and vice versa.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM on 3 pins</title><link>https://devzone.nordicsemi.com/thread/94678?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 12:07:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16464784-ddd1-4b76-8f68-a8fcf8d28df2</guid><dc:creator>bojerko</dc:creator><description>&lt;p&gt;Ah yes ... for some strange reasons I have two nrf_drv_config.h files and in one the setup was proper, but in the other not. So it compiles, but the LED on the pin with PWM2 still doesn&amp;#39;t light on. If I move it to PWM1 it turns on.
Looks like I&amp;#39;m still missing something in setting :(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM on 3 pins</title><link>https://devzone.nordicsemi.com/thread/94675?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 11:17:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc3f5513-ed20-428e-a647-548ac7b9aa87</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Yes, you need to make sure that you have &lt;code&gt;#define TIMER2_ENABLED 1&lt;/code&gt; in nrf_drv_config.h&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM on 3 pins</title><link>https://devzone.nordicsemi.com/thread/94674?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 11:14:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa574446-01e4-4e6f-b1fb-49b84b6ab710</guid><dc:creator>bojerko</dc:creator><description>&lt;p&gt;I just copied APP_PWM_INSTANCE(PWM1,1); and changed PWM1 to PWM2.
Now I change the 1 to 2, but get the error:
error: &amp;#39;TIMER2_INSTANCE_INDEX&amp;#39; undeclared here (not in a function)&lt;/p&gt;
&lt;p&gt;I guess I need to setup something in nrf_drv_config.h although both timers are on (1 and 2).
Do you have an idea what might be solution to that?
Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM on 3 pins</title><link>https://devzone.nordicsemi.com/thread/94673?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 11:05:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d10aa13f-2f3c-4205-8885-7669f18445c9</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Are you using TIMER2 for the PWM2 instance? i.e.:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;APP_PWM_INSTANCE(PWM2,2);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM on 3 pins</title><link>https://devzone.nordicsemi.com/thread/94672?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 09:44:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13d49f7d-001f-4d56-af84-18749fcff9be</guid><dc:creator>bojerko</dc:creator><description>&lt;p&gt;Ah, yes. I missed this one. Thanks for that.
At least 15 and 16 are now on, but 17 is still off :/&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM on 3 pins</title><link>https://devzone.nordicsemi.com/thread/94671?ContentTypeID=1</link><pubDate>Thu, 03 Aug 2017 09:39:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:004e1d1e-6492-49e3-ab6e-9725e5e576ab</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It looks like you are initializing the first PWM instance twice. I.e. you should change your line&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = app_pwm_init(&amp;amp;PWM1,&amp;amp;pwm3_cfg,pwm_ready_callback3);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = app_pwm_init(&amp;amp;PWM2,&amp;amp;pwm3_cfg,pwm_ready_callback3);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>