<?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>Reassign PWM pin</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10865/reassign-pwm-pin</link><description>I have 5 LEDs - ideally I would like to control the brightness of each one independently (i.e. 5 PWM channels). I&amp;#39;m using SDK 9.0 and SD 310. I have been looking at the PWM example, and it looks like I can configure 2 pwm channels per timer, so a total</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Dec 2015 10:01:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10865/reassign-pwm-pin" /><item><title>RE: Reassign PWM pin</title><link>https://devzone.nordicsemi.com/thread/40656?ContentTypeID=1</link><pubDate>Tue, 15 Dec 2015 10:01:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e9734a6-7425-4508-87ba-1c2b0ded54f0</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You can have max 4 pwm channels, this is also limited to the number of GPIOTE channels on nRF51 which is 4.&lt;/p&gt;
&lt;p&gt;The PWM driver in the SDK runs with SoftDevice, but in SDK 9 there was problems regarding the app_pwm_init and app_pwm_enable functions. You should use the driver from SDK 10 (either do your project in this SDK or use the app_pwm files from this SDK). This driver have fixed a lot of things.&lt;/p&gt;
&lt;p&gt;You will have to uninit the pwm, assign a new pin and then init the pwm again to switch pin. More detailed:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = app_pwm_uninit(&amp;amp;PWM);
APP_ERROR_CHECK(err_code);

pwm_cfg.pins[0] = LED1;  //new pin

err_code = app_pwm_init(&amp;amp;PWM,&amp;amp;pwm_cfg,pwm_ready_callback);
APP_ERROR_CHECK(err_code);

app_pwm_enable(&amp;amp;PWM);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>