<?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>Cant run simple PWM output on NRF5340</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83645/cant-run-simple-pwm-output-on-nrf5340</link><description>Hi All! 
 I have a problem running simple PWM output on NRF5340 board. I have a following code: 
 
 Now what i&amp;#39;m trying to achieve is to get 50% of duty cycle with frequency of 2 kHz. Just simple wave coming out of pin in PWM_0. 
 What i&amp;#39;m currently getting</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 14 Jan 2022 07:06:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83645/cant-run-simple-pwm-output-on-nrf5340" /><item><title>RE: Cant run simple PWM output on NRF5340</title><link>https://devzone.nordicsemi.com/thread/347679?ContentTypeID=1</link><pubDate>Fri, 14 Jan 2022 07:06:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c89aa8bd-b8d2-4b8e-8e16-33121f7b3723</guid><dc:creator>Michal Obrembski</dc:creator><description>&lt;p&gt;This is from Nordic SDK:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;nrf_pwm_values_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;values&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;span&gt; ///&amp;lt; Pointer to an array with duty &lt;strong&gt;cycle values&lt;/strong&gt;. This array must be in Data RAM.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; /**&amp;lt; This field is defined as an union of pointers&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; * to provide a convenient way to define &lt;strong&gt;duty&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; * &lt;strong&gt;cycle values&lt;/strong&gt; in various loading modes&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; * (see @ref nrf_pwm_dec_load_t).&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; * In each value, the most significant bit (15)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; * determines the polarity of the output and the&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; * others (14-0) compose the 15-bit value to be&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; * compared with the pulse generator counter. */&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;So basically youre trying to tell me that they&amp;#39;re actually expecting compare value not duty cycle (which normally is denoted in percentage)?&lt;br /&gt;If so, i suggest better naming here&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cant run simple PWM output on NRF5340</title><link>https://devzone.nordicsemi.com/thread/347657?ContentTypeID=1</link><pubDate>Thu, 13 Jan 2022 17:57:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:708f34e8-b39f-4d0c-916a-d26954a5d079</guid><dc:creator>PaKa</dc:creator><description>&lt;p&gt;So a compare value of 50 when the top value is 62 should give a duty cycle around 80% so looks correct (assuming the values are not converted to duty cycle in the driver). If this is correct, set the values.channel to 50% of the initial_config.top_value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>