<?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>Devicetree Visual Editor PWM signal configuration question</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110931/devicetree-visual-editor-pwm-signal-configuration-question</link><description>Hi, 
 I want to implement a pwm output signal on a particular pin of the nRF52840DK working with the latest nRF Connect for VS Code. What would be the recommended way to setup the configuration using the Devicetree Visual Editor? I&amp;#39;m getting confused</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 15 May 2024 07:51:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110931/devicetree-visual-editor-pwm-signal-configuration-question" /><item><title>RE: Devicetree Visual Editor PWM signal configuration question</title><link>https://devzone.nordicsemi.com/thread/483407?ContentTypeID=1</link><pubDate>Wed, 15 May 2024 07:51:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a1581e0-771f-470f-bc46-eed8e0ece363</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Happy to hear that, Ken! We do appreciate the feedback!&lt;/p&gt;
[quote user="Ken58"]I will be doing a custom board .dts with a&amp;nbsp;Fanstel BM840 in the near future.&amp;nbsp; Should be fun![/quote]
&lt;p&gt;You&amp;#39;ve probably seen it already, but anyways I&amp;#39;ll recommend you to have a look at lesson 3 in the intermediate course for adding custom board support :) This lesson&amp;nbsp;&lt;em&gt;&lt;/em&gt;should atleast give you a good starting point. And if you want to refresh some general knowledge regarding overlay and .dts you can have a look at the lesson 2 and 3 in the&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/"&gt;fundamentals course&lt;/a&gt;&amp;nbsp;as well&lt;/p&gt;
&lt;p&gt;I assume that the original question in this case has been answered, so I&amp;#39;ll mark the case as answered for now, but please feel free to create new cases for new topics/questions unrelated to this case and/or to ask follow up questions if you have any additional questions related to this specific topic!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Devicetree Visual Editor PWM signal configuration question</title><link>https://devzone.nordicsemi.com/thread/483357?ContentTypeID=1</link><pubDate>Tue, 14 May 2024 19:59:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e3250a2-0f86-4552-821a-70a67accf74f</guid><dc:creator>Ken58</dc:creator><description>&lt;p&gt;Hi Andreas,&lt;/p&gt;
&lt;p&gt;Thanks very much for stepping in for&amp;nbsp;&lt;span&gt;&amp;Oslash;yvind.&amp;nbsp; The entire team at Nordic does an outstanding job with DevZone support.&amp;nbsp; I couldn&amp;#39;t ask for more!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I stand corrected on exercise 2.&amp;nbsp; I see it now.&amp;nbsp; Thank you for pointing this out.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also, thank you for your additional comment on Devicetree Visual Editor.&amp;nbsp; I will be doing a custom board .dts with a&amp;nbsp;Fanstel BM840 in the near future.&amp;nbsp; Should be fun!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Ken&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Devicetree Visual Editor PWM signal configuration question</title><link>https://devzone.nordicsemi.com/thread/483064?ContentTypeID=1</link><pubDate>Mon, 13 May 2024 13:21:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c95788fe-0c51-49e9-afff-6cfdf43d7296</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Øyvind is currently out of office so I&amp;#39;ll be handling this case until he&amp;#39;s back.&lt;/p&gt;
[quote user="Ken58"]Yes, I have seen the course, which is good, but it does not address my question[/quote]
&lt;p&gt;The PWM course does address this. If you follow along with exercise 2 you will end up with an overlay that looks like this for the nRF52840DK&amp;nbsp;&lt;a href="https://github.com/NordicDeveloperAcademy/ncs-inter/blob/main/lesson4/inter_less4_exer2_solution/boards/nrf52840dk_nrf52840.overlay"&gt;https://github.com/NordicDeveloperAcademy/ncs-inter/blob/main/lesson4/inter_less4_exer2_solution/boards/nrf52840dk_nrf52840.overlay&lt;/a&gt;&amp;nbsp;i.e compatibles that are not coupled with the pmw_led instances, which is how I wrote the exercise to do. From here can set up the different channels through the Devicetree visual helper or by further modifying the overlayfile (i.e select which channels the pwm instances should use).&lt;/p&gt;
[quote user="Ken58"] The Devicetree Visual Editor can&amp;#39;t do everything you might want.&amp;nbsp; I had to edit the .overlay file directly to define the required nodes, like pwm_led_0 in your example.&amp;nbsp; Correct?[/quote]
&lt;p&gt;Yes, this is correct. The proper way to do this is to do it through .overlay files or in the case of custom boards to do it in the .dts or board files directly. Think of the Devicetree helper as a &amp;quot;helper&amp;quot; and not a complete tool w.r.t how the documentations states to modify overlay-files.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Devicetree Visual Editor PWM signal configuration question</title><link>https://devzone.nordicsemi.com/thread/482604?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 19:26:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bed66639-d1a2-4a71-ae7f-5d4768f04a5b</guid><dc:creator>Ken58</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;&amp;Oslash;yvind,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yes, that will work, but:&amp;nbsp; My PWM signals are not related to LEDs at all.&amp;nbsp; How would I separate these signals from &amp;quot;compatible = &amp;quot;pwm-leds&amp;quot;?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also, to confirm what I think your answer shows:&amp;nbsp; The Devicetree Visual Editor can&amp;#39;t do everything you might want.&amp;nbsp; I had to edit the .overlay file directly to define the required nodes, like pwm_led_0 in your example.&amp;nbsp; Correct?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Ken&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Devicetree Visual Editor PWM signal configuration question</title><link>https://devzone.nordicsemi.com/thread/482521?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 12:38:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8fcf963-c9eb-46a7-bb73-27dca7d8af55</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hi Ken, thanks for elaborating.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You configure the channels in the i.e.&amp;nbsp;&lt;code&gt;nrf52840dk_nrf52840.overlay.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Edit: Here I&amp;#39;ve used the Blinky PWM sample and its .overlay file as an example.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pwm0 {
	status = &amp;quot;okay&amp;quot;;
};

&amp;amp;sw_pwm {
	status = &amp;quot;okay&amp;quot;;
	channel-gpios = &amp;lt;&amp;amp;gpio0 13 PWM_POLARITY_INVERTED&amp;gt;;
};


/ {
	pwmleds {
		compatible = &amp;quot;pwm-leds&amp;quot;;
		pwm_led0: pwm_led_0 {
			pwms = &amp;lt;&amp;amp;pwm0 0 PWM_MSEC(8) PWM_POLARITY_NORMAL&amp;gt;;
		};
		pwm_led1: pwm_led_1 {
			pwms = &amp;lt;&amp;amp;pwm0 1 PWM_MSEC(8) PWM_POLARITY_NORMAL&amp;gt;;
		};
		pwm_led2: pwm_led_2 {
			pwms = &amp;lt;&amp;amp;pwm0 2 PWM_MSEC(8) PWM_POLARITY_NORMAL&amp;gt;;
		};
	};
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This should allow you to select correct channel&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/7673.pastedimage1715171878903v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Devicetree Visual Editor PWM signal configuration question</title><link>https://devzone.nordicsemi.com/thread/482393?ContentTypeID=1</link><pubDate>Tue, 07 May 2024 23:45:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4706f5f-c942-4eac-b59a-d3a4a36a20e1</guid><dc:creator>Ken58</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;&amp;Oslash;yvind,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yes, I have seen the course, which is good, but it does not address my question.&amp;nbsp; This picture shows the pwm0 section from the Devicetree Visual Editor.&amp;nbsp; I set up pwm0 channel 1 using the zephyr,user node.&amp;nbsp; No problems.&amp;nbsp; How would you recommend setting up channels 2 and 3 of pwm0?&amp;nbsp; If I select zephyr,user from the dropdown after clicking the &amp;quot;+&amp;quot; to the left of CH2, my CH1 setup is removed.&amp;nbsp; It is like I can only setup 1 additional channel beyond the default overlay.&amp;nbsp; Is there a Kconfig option I&amp;#39;m missing or something else?&amp;nbsp; Try it yourself.&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-2024_2D00_05_2D00_07-192817.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Ken&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Devicetree Visual Editor PWM signal configuration question</title><link>https://devzone.nordicsemi.com/thread/482379?ContentTypeID=1</link><pubDate>Tue, 07 May 2024 19:51:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7fd7ad99-d0a3-4d85-baf5-8fefa66e7ae1</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello Ken,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you seen our &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/"&gt;intermediate course for nRF Connect SDK in our Developer Academy&lt;/a&gt;? In lesson 4 of this course it covers how to configure a PWM pin.&amp;nbsp;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;span&gt;In the exercise section of this lesson, we will practice controlling an LED on the DK using the PWM API. Then we will modify the devicetree to control an external servo motor device, and how to add a second PWM instance to be able to control both the servo and an LED on the board.&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;Please have a look at this course and let me know if this answers your questions.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>