<?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>Trying to set up PWMs on a custom board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92851/trying-to-set-up-pwms-on-a-custom-board</link><description>Hi, 
 I am trying to set up PWMs on a custom board, but I am not able to observe the outputs using an oscilloscope (pins are constantly at 0V). The PWM channels should be set to P0.26 and P0.27. 
 Here is my device tree: 
 
 
 In the main.c file, I am</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Oct 2022 20:56:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92851/trying-to-set-up-pwms-on-a-custom-board" /><item><title>RE: Trying to set up PWMs on a custom board</title><link>https://devzone.nordicsemi.com/thread/391754?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2022 20:56:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9ee0f13-1c9b-4290-8f5e-5f838c6af139</guid><dc:creator>Paul15</dc:creator><description>&lt;p&gt;Hi Oivind,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I was able to figure out the issue, it looks like this was due to an incorrect setting in the device tree.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;pwm_dev0: pwm_dev0 {&lt;br /&gt; pwms = &amp;lt;&amp;amp;pwm0 26 PWM_USEC(1000) PWM_POLARITY_NORMAL&amp;gt;;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Should be set to &amp;amp;pwm0 0 instead (PWM channel, not port channel)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to set up PWMs on a custom board</title><link>https://devzone.nordicsemi.com/thread/391628?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2022 11:34:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c046d114-8b22-43cb-bb75-e62ef7abeada</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Try to edit blinky_pwm to use your pwm_dev0 node instead. It would be very helpful to know if that works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to set up PWMs on a custom board</title><link>https://devzone.nordicsemi.com/thread/391039?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 15:48:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:062e98cf-4b82-48be-b6c7-fb0cc9c20726</guid><dc:creator>Paul15</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/78052.main.c"&gt;devzone.nordicsemi.com/.../78052.main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to set up PWMs on a custom board</title><link>https://devzone.nordicsemi.com/thread/391038?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 15:47:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d628b6a-4a7c-4725-9d35-4922e8cfe67d</guid><dc:creator>Paul15</dc:creator><description>&lt;p&gt;Blinky is using the default pin of that project.&amp;nbsp; I have tested pins 0.26 and 0.27 as GPIOs, and they are able to toggle.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to set up PWMs on a custom board</title><link>https://devzone.nordicsemi.com/thread/391036?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 15:44:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e4edaee-1963-4489-9846-57240258ddac</guid><dc:creator>Paul15</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi Oivind,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;pwm_set_dt is returning &amp;quot;-22&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to set up PWMs on a custom board</title><link>https://devzone.nordicsemi.com/thread/390973?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 11:27:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7432936a-d28c-4b1d-a1ea-cbdfe132b1fc</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;To be clear, blinky_pwm works correctly with the leds on P0.26 and P0.27?&lt;/p&gt;
&lt;p&gt;If so, could I see The full code for your main.c? And can you check the return values for the calls to pwm_set_dt()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to set up PWMs on a custom board</title><link>https://devzone.nordicsemi.com/thread/390834?ContentTypeID=1</link><pubDate>Fri, 14 Oct 2022 15:42:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:393f695c-77fd-41f5-80d0-59960d26135e</guid><dc:creator>Paul15</dc:creator><description>&lt;p&gt;Hi Oivind,&lt;/p&gt;
&lt;p&gt;I have tried&amp;nbsp;&lt;span&gt;blinky_pwm and that works correctly.&amp;nbsp;&amp;nbsp;Blinky is also what I used as an example for this project.&amp;nbsp;&amp;nbsp;&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: Trying to set up PWMs on a custom board</title><link>https://devzone.nordicsemi.com/thread/390797?ContentTypeID=1</link><pubDate>Fri, 14 Oct 2022 11:11:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f6c2e0c-333a-48ba-8ea8-c13091059568</guid><dc:creator>&amp;#216;ivind</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;As a start, could you try &lt;br /&gt;zephyr/samples/basic/blinky_pwm&lt;br /&gt;and see if that works?&lt;/p&gt;
&lt;p&gt;That should narrow down where the issue is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to set up PWMs on a custom board</title><link>https://devzone.nordicsemi.com/thread/390713?ContentTypeID=1</link><pubDate>Thu, 13 Oct 2022 21:46:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:793b30bc-c592-4fb1-8afc-118f1512332e</guid><dc:creator>Paul15</dc:creator><description>&lt;p&gt;Other comments:&lt;/p&gt;
&lt;p&gt;-&amp;nbsp; Program compiles correctly and is able to be flashed to the PCBA.&lt;/p&gt;
&lt;p&gt;-&amp;nbsp; Other part of the program work, so it is executing interrupts correctly.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>