<?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>How to reassign LED pin values in NRF Connect SDK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93421/how-to-reassign-led-pin-values-in-nrf-connect-sdk</link><description>I&amp;#39;m having trouble reassigning the pin value for the LED&amp;#39;s in the connect SDK. I am using the base PWM Blinky example and have changed the pin value assigned to PWM_LED0 in the dts file but it does not reflect this during the debugging and still blinks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 01 Nov 2022 17:48:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93421/how-to-reassign-led-pin-values-in-nrf-connect-sdk" /><item><title>RE: How to reassign LED pin values in NRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/393536?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 17:48:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb1c142d-19bc-4e48-9b04-feb87a45f3c7</guid><dc:creator>Naeem Maroof</dc:creator><description>&lt;p&gt;Hi Joe,&lt;/p&gt;
&lt;p&gt;Good to know that you have found a solution.&amp;nbsp;There can&amp;nbsp;be other solutions as well like enabling PWM1 and connecting to LED1. However, the solution of changing PWM0 pin to LED1 through overlay is also suitable for your problem. On nRF52840, LEDS are connected to 13-16 pins on port-0.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;&amp;amp;pwm0_default {
    phandle = &amp;lt; 0xd &amp;gt;;
    group1 {
        psels = &amp;lt; NRF_PSEL(PWM_OUT0, 0, 0xe) &amp;gt;;
        nordic,invert;
    };
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Using NRF52840, the led#2 of the board (actually led1) will be connected to the PWM through this overlay.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Naeem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reassign LED pin values in NRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/393325?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2022 17:19:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:838d3580-9cff-4c4a-add6-8977f664eac1</guid><dc:creator>nordicator_prim3</dc:creator><description>&lt;p&gt;No problem, it was a fun problem! Im hoping there&amp;#39;s a better way to do this -- it feels a bit hacky.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reassign LED pin values in NRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/393324?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2022 17:19:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c2f2f9a-0ae4-43da-bc1f-eb5ca1c6ce4d</guid><dc:creator>nordicator_prim3</dc:creator><description>&lt;p&gt;Just found a slightly friendlier way using the NRF_PSEL() function. Now my overlay looks like this to use led2:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pwm0_default {
    phandle = &amp;lt; 0xd &amp;gt;;
    group1 {
        psels = &amp;lt; NRF_PSEL(PWM_OUT0, 0, 0xf) &amp;gt;;
        nordic,invert;
    };
};&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reassign LED pin values in NRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/393323?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2022 17:18:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c40ddcff-3192-4f42-8286-10caadde0001</guid><dc:creator>jrmorris</dc:creator><description>&lt;p&gt;Changing the psel to the new pin value worked for me, Thank you very much!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reassign LED pin values in NRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/393321?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2022 17:07:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5926d683-7cff-4e36-b448-1585395ea6d2</guid><dc:creator>nordicator_prim3</dc:creator><description>&lt;p&gt;So I hadn&amp;#39;t messed with PWMs before, but I think I figured something out. Also, I only have an nrf52840dk, so I&amp;#39;ll show you what my devicetree looks like and you can relate it to your board.&lt;br /&gt;&lt;br /&gt;First is where the devicetree defines &amp;quot;pwmleds&amp;quot; and &amp;quot;pwm_led0&amp;quot;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;pwmleds {
	compatible = &amp;quot;pwm-leds&amp;quot;;
	pwm_led0: pwm_led_0 {
		pwms = &amp;lt; &amp;amp;pwm0 0x0 0x1312d00 0x1 &amp;gt;;
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So that shows it pointing to &amp;quot;pwm0&amp;quot; node:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;pwm0: pwm@4001c000 {
	compatible = &amp;quot;nordic,nrf-pwm&amp;quot;;
	reg = &amp;lt; 0x4001c000 0x1000 &amp;gt;;
	interrupts = &amp;lt; 0x1c 0x1 &amp;gt;;
	status = &amp;quot;okay&amp;quot;;
	label = &amp;quot;PWM_0&amp;quot;;
	#pwm-cells = &amp;lt; 0x3 &amp;gt;;
	pinctrl-0 = &amp;lt; &amp;amp;pwm0_default &amp;gt;;
	pinctrl-1 = &amp;lt; &amp;amp;pwm0_sleep &amp;gt;;
	pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
	phandle = &amp;lt; 0x19 &amp;gt;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And then, &amp;quot;pinctrl-0&amp;quot; pointing to &amp;quot;pwm0_default&amp;quot; sounded enticing, so I looked at it:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;pwm0_default: pwm0_default {
	phandle = &amp;lt; 0xd &amp;gt;;
	group1 {
		psels = &amp;lt; 0x16000e &amp;gt;;
		nordic,invert;
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Which looked strange. The psels point to &amp;quot;0x16000d&amp;quot;. I made a devicetree overlay that redefined the psels in &amp;quot;pwm0_default&amp;quot; to 0x16000e and that started using the second LED. On my devkit, &amp;quot;led0&amp;quot; is pin 0xd and &amp;quot;led1&amp;quot; is 0xe. so it seems like you just need to add 0x160000 to whatever pin you want in the &amp;quot;psels&amp;quot; for &amp;quot;pwm0_default&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reassign LED pin values in NRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/393306?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2022 15:44:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83e7aa43-4bc5-4765-8fec-31a868e8e281</guid><dc:creator>jrmorris</dc:creator><description>&lt;p&gt;NRF52832&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reassign LED pin values in NRF Connect SDK</title><link>https://devzone.nordicsemi.com/thread/393304?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2022 15:41:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9934f1fc-910d-4f3e-af70-8a0e46cc7249</guid><dc:creator>nordicator_prim3</dc:creator><description>&lt;p&gt;Which DK board are you using? NRF52840?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>