<?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>NRFX PWM Driver with Zephyr Threads combination</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111494/nrfx-pwm-driver-with-zephyr-threads-combination</link><description>Hi there, 
 Currently we are developing our own system to drive WS2812B LED&amp;#39;s using the NRFX pwm library. And the coloring and signaling works fine when it is in a bare metal mode, however once the I wish to loop over the nrfx_pwm_simple_playback ();</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 May 2024 07:50:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111494/nrfx-pwm-driver-with-zephyr-threads-combination" /><item><title>RE: NRFX PWM Driver with Zephyr Threads combination</title><link>https://devzone.nordicsemi.com/thread/486805?ContentTypeID=1</link><pubDate>Fri, 31 May 2024 07:50:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79590fcd-8a9d-487b-90a3-27538580271f</guid><dc:creator>TGosman</dc:creator><description>&lt;p&gt;All Good, I found a solution where i link PPI from the SEQ0END event to trigger the STOP task, so that the sequence can be reset before it is run again. Thank you for your help!&lt;pre class="ui-code" data-mode="c_cpp"&gt;void configurePPI(void){
    uint8_t pwm_stop_ppi_channel;
    nrfx_err_t err = nrfx_gppi_channel_alloc(&amp;amp;pwm_stop_ppi_channel);
    if (err != NRFX_SUCCESS) {
        LOG_ERR(&amp;quot;nrfx_gppi_channel_alloc error: %08x&amp;quot;, err);
        return;
    }
    nrfx_gppi_channel_endpoints_setup(pwm_stop_ppi_channel,nrfx_pwm_event_address_get(&amp;amp;pwm_instance1, NRF_PWM_EVENT_SEQEND0),
                                  nrf_pwm_task_address_get(pwm_instance1.p_reg,  NRF_PWM_TASK_STOP));

    nrfx_gppi_channels_enable(BIT(pwm_stop_ppi_channel));
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRFX PWM Driver with Zephyr Threads combination</title><link>https://devzone.nordicsemi.com/thread/486784?ContentTypeID=1</link><pubDate>Fri, 31 May 2024 06:55:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bec97ffb-2097-4b77-a292-16903119a5e1</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for confirming. Can you upload your code with the current changes so I can have another look at your implementation?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRFX PWM Driver with Zephyr Threads combination</title><link>https://devzone.nordicsemi.com/thread/486779?ContentTypeID=1</link><pubDate>Fri, 31 May 2024 06:38:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c2179a3-c4d1-4100-bc99-209699faa98b</guid><dc:creator>TGosman</dc:creator><description>&lt;p&gt;yes there is no change&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRFX PWM Driver with Zephyr Threads combination</title><link>https://devzone.nordicsemi.com/thread/485966?ContentTypeID=1</link><pubDate>Mon, 27 May 2024 08:19:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd291080-98b8-4cab-91fd-6f910ba4acc7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;&lt;span&gt;Do you see the same if you comment out the code in your&amp;nbsp;pwm_handler()?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRFX PWM Driver with Zephyr Threads combination</title><link>https://devzone.nordicsemi.com/thread/485780?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 10:37:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1c6fa48-c678-49f7-952d-bf099bfb2c1f</guid><dc:creator>TGosman</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;Thank you for your response, this allows for me to call the playback function within each thread, however my current problem is that the playback function cannot play more than once, and I am unsure if there is anything else I have to do.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;for(int i = 0; i &amp;gt; 0; i++){
    nrfx_pwm_simple_playback(&amp;amp;pwm_instance, &amp;amp;seq_set1, i, NRFX_PWM_FLAG_LOOP);

}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRFX PWM Driver with Zephyr Threads combination</title><link>https://devzone.nordicsemi.com/thread/485767?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 09:51:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bb343f6-9ee7-4e38-94aa-872dc511a188</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It looks like you are defining multiple driver instances for the same PWM. I suggest moving &amp;#39;nrfx_pwm_t pwm_instance1 = NRFX_PWM_INSTANCE(PWM_INST_IDX);&amp;#39; to the global scope and&amp;nbsp;then use&amp;nbsp;same &amp;#39;pwm_instance1&amp;#39; for your pwm functions. I posted another example with PWM here:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/104487/softblink-in-ncs-zephyr"&gt;Softblink in NCS/Zephyr&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>