<?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>Issues with PWM on nRF52</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15125/issues-with-pwm-on-nrf52</link><description>I have encountered two issues while using the NRF PWM driver on the nRF52 DK, with or without SoftDevice S132, along with SDK v11.0.0 
 The first one is the use of the NRF_DRV_PWM_PIN_INVERTED flag. Looking at the oscilloscope, I don&amp;#39;t see the waveform</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 29 Jan 2022 19:37:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15125/issues-with-pwm-on-nrf52" /><item><title>RE: Issues with PWM on nRF52</title><link>https://devzone.nordicsemi.com/thread/350315?ContentTypeID=1</link><pubDate>Sat, 29 Jan 2022 19:37:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93832306-b6f8-4ea6-8c04-eba2d7143a1d</guid><dc:creator>AbbaS7</dc:creator><description>&lt;p&gt;Thanks for your suggestion. I created a new ticket &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/84200/nrf52840-dongle-pwm-signals-with-arbitrary-phase-shift-and-duty-cycle"&gt;here&lt;/a&gt;:&lt;/p&gt;
&lt;h1 class="name" id="mcetoc_1fqjlehu60"&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;font-size:75%;"&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/84200/nrf52840-dongle-pwm-signals-with-arbitrary-phase-shift-and-duty-cycle"&gt;NRF52840 dongle PWM signals with arbitrary phase-shift and duty cycle&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with PWM on nRF52</title><link>https://devzone.nordicsemi.com/thread/350115?ContentTypeID=1</link><pubDate>Fri, 28 Jan 2022 08:05:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbf1f51e-d0ef-481f-9463-8c0e3e066f94</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;This case is more than 5 years old at this point, and the nRF52840 Dongle is newer than this ticket. Please create a new ticket where you describe the problem in detail. Feel free to link to this ticket if you find it relevant though.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with PWM on nRF52</title><link>https://devzone.nordicsemi.com/thread/350091?ContentTypeID=1</link><pubDate>Thu, 27 Jan 2022 23:35:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:412d857e-cb58-4f93-8bbd-bf8a0c1117e3</guid><dc:creator>AbbaS7</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have still the same problem. I am using a similar PWM_driver example and no matter if I use | 0x8000 or the&amp;nbsp;&lt;span&gt;NRF_DRV_PWM_PIN_INVERTED flag, the polarity of my pin do not change and I cannot see any polarity change in the oscilloscope. I am using an nrf52840 dongle.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I plan two build two PWM signals that the user is able to change not only the duty cycle of that but also make an arbitrary phase-shift between the two signals.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you guys help me with the polarity problem?&lt;br /&gt;Besides, any suggestion regarding the phase shift and how to build that would be appreciated.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with PWM on nRF52</title><link>https://devzone.nordicsemi.com/thread/162173?ContentTypeID=1</link><pubDate>Mon, 17 Dec 2018 20:10:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a9568de-223b-490d-a89a-c1768dd2683c</guid><dc:creator>grzegorz</dc:creator><description>&lt;p&gt;Hello &lt;a href="https://devzone.nordicsemi.com/members/olba"&gt;Ole Bauck&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Is last value playing fixed in current SDK?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with PWM on nRF52</title><link>https://devzone.nordicsemi.com/thread/57741?ContentTypeID=1</link><pubDate>Fri, 15 Jul 2016 08:10:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd9b53b3-ae5e-45c5-9829-9a46ca2fd3df</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Thanks Ole. The trick with making the sequence size 1 value longer is exactly what I am using instead. And the note about bit 15 determining the polarity is appreciated. I completely overlooked that piece of info.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issues with PWM on nRF52</title><link>https://devzone.nordicsemi.com/thread/57740?ContentTypeID=1</link><pubDate>Thu, 14 Jul 2016 12:11:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88383beb-9c07-4262-828f-dc94d6ecb779</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;NRF_DRV_PWM_PIN_INVERTED only determines the idle state polarity, the 15th bit in the sequence value determines the polarity when playing the sequence, see &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/structnrf__pwm__sequence__t.html#ad3244198df7ea3a206740dacd398db1e"&gt;here&lt;/a&gt;. To change the polarity, you have to or with 0x8000, for example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Value = 4 | 0x8000;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The problem with the last duty not being played is a bug (or feature) in the SDK driver. When using nextstep to load new values from RAM the PWM peripheral does not know how many periods this value should be played, unlike when using RefreshCount where the number of periods is defined by the refresh field in the sequence. Therefore, the peripheral trigger the LOOPSDONE event when the last value is loaded from RAM. Since the driver sets up a short between LOOPSDONE event and SEQUENCE_START task, the sequence starts to load the first value from RAM and hence the last value have no time to be played.&lt;/p&gt;
&lt;p&gt;A simple workaround is to define the sequence to be one value longer, since the last value is not played when using nextstep.&lt;/p&gt;
&lt;p&gt;I will report this internally to see if we can fix this in future SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>