<?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>PWM Driver - Proper Way to Update Sequence</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33821/pwm-driver---proper-way-to-update-sequence</link><description>I am using a nRF52832 and v14.2 of the Nordic SDK. I have a question about the PWM Driver. I have the pwm driver working and driving an LED, but it is unclear to me how to properly update the sequence. I have scanned the forum, and the answers I found</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 May 2018 13:37:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33821/pwm-driver---proper-way-to-update-sequence" /><item><title>RE: PWM Driver - Proper Way to Update Sequence</title><link>https://devzone.nordicsemi.com/thread/131034?ContentTypeID=1</link><pubDate>Fri, 04 May 2018 13:37:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbd5fdd7-6f99-42a3-9747-fde37d2da9cf</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the project, I see the same issue here.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The behavior seems to be caused by two factors:&lt;/p&gt;
&lt;p&gt;a) The end_delay is added between each playback of the sequence, not after the sequence has looped X number of times.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;b) On the last loop the end_delay is not added, so that the sequence is played back twice in succession.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This behavior is more obvious if you increase the loop count to 3.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I will check with the SDK guys next week if this is expected behavior, or if there is some bug in the driver.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As a temporary workaround I would suggest the following: Set the end_delay to 0, and use the loop value to determine how many times the sequence should loop before the delay.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Use an app_timer (or a dedicated RTC timer) to&amp;nbsp;control the delay between sequence loops, rather than the end_delay factor. The simplest way to do this is to&amp;nbsp;call&amp;nbsp;nrf_drv_pwm_simple_playback(..) directly from the app_timer callback.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM Driver - Proper Way to Update Sequence</title><link>https://devzone.nordicsemi.com/thread/130142?ContentTypeID=1</link><pubDate>Fri, 27 Apr 2018 14:32:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d1161bd-440b-42f0-8e30-55b140c6045b</guid><dc:creator>amorgan</dc:creator><description>&lt;p&gt;ovrebekk, thanks for the example code. I have modified your example to reproduce the error that I am seeing in my code.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I set Channels 1 - 3 to NRF_DRV_PWM_PIN_NOT_USED. And modified the sequence to match what I am trying to achieve. I do want the flashing sequence to loop because I would like for this to loop until the state is changed (this will act as a warning sequence).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The issue I am seeing is that after pressing button 2, to start the &amp;quot;static&amp;quot; sequence, that is just one value, then pressing button 1 to start the &amp;quot;flashing&amp;quot; sequence, even though the playback is set to 2, on the very first playback, it only plays it once, delays, then every sequence after that, it does playback twice, then loops.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;More succinctly :&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1) Press Button 2&lt;/p&gt;
&lt;p&gt;2) LED 1 is on static&lt;/p&gt;
&lt;p&gt;3) Press Button 1&lt;/p&gt;
&lt;p&gt;4) LED 1 turns off, turns on (not expected)&lt;/p&gt;
&lt;p&gt;5) LED 1 sequence delays&lt;/p&gt;
&lt;p&gt;6) LED 1 turns off, turns on, turns off, turns on (exprected)&lt;/p&gt;
&lt;p&gt;7) LED 1 sequence delays&lt;/p&gt;
&lt;p&gt;8) Sequence continues to loop&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Step 4 is what is not expected. I expect it to behave like step 6 immediately.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8780.pwm_5F00_driver_5F00_sequence_5F00_static_5F00_modified.zip"&gt;/cfs-file/__key/communityserver-discussions-components-files/4/8780.pwm_5F00_driver_5F00_sequence_5F00_static_5F00_modified.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM Driver - Proper Way to Update Sequence</title><link>https://devzone.nordicsemi.com/thread/130063?ContentTypeID=1</link><pubDate>Fri, 27 Apr 2018 07:36:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5fe8427-371a-494f-942a-4da3eecbe0f9</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Just to be clear, some times you need to set the PWM to a static value, and other times you want to play a sequence?&lt;/p&gt;
&lt;p&gt;I modified the standard SDK example to do something similar, and you will find it &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-e0682575546b4468a00b51fb33902f34/pwm_5F00_driver_5F00_sequence_5F00_static.zip"&gt;attached&lt;/a&gt;. Pressing button 1 will start a sequence, and pressing button 2 will set the 4 LED&amp;#39;s to static values.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Exactly what is wrong with your example I am not sure. If you are trying to play a sequence I would use&amp;nbsp;NRF_DRV_PWM_FLAG_STOP rather than&amp;nbsp;NRF_DRV_PWM_FLAG_LOOP. Otherwise there is nothing in your code that jumps out at me.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>