<?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 PERIODEND Event missing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/121410/nrfx-pwm-periodend-event-missing</link><description>The nrfx pwm supports a number of events for a callback: /** @brief PWM driver event type. */ typedef enum { NRFX_PWM_EVT_FINISHED, ///&amp;lt; Sequence playback finished. NRFX_PWM_EVT_END_SEQ0, /**&amp;lt; End of sequence 0 reached. Its data can be safely modified</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 May 2025 09:16:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/121410/nrfx-pwm-periodend-event-missing" /><item><title>RE: nrfx pwm PERIODEND Event missing</title><link>https://devzone.nordicsemi.com/thread/535493?ContentTypeID=1</link><pubDate>Thu, 15 May 2025 09:16:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:685e6e13-a4a9-435e-9e54-a138bc00ee74</guid><dc:creator>JasonJibrail</dc:creator><description>&lt;p&gt;Thanks Kenneth,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I might try this - for now I&amp;#39;ve used the EGU and PPI to accomplish what I needed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfx pwm PERIODEND Event missing</title><link>https://devzone.nordicsemi.com/thread/535106?ContentTypeID=1</link><pubDate>Tue, 13 May 2025 11:50:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63893ebb-bc54-4d4c-9147-df7b04d5d24a</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I guess you would need to use the nrfx_pwm api directly (instead of the zephyr pwm or pwm_nrfx api).&lt;/p&gt;
&lt;p&gt;There is possible starting example here:&lt;br /&gt;&lt;a href="https://github.com/too1/ncs-nrfx-pwm-simple-example/blob/master/src/main.c"&gt;https://github.com/too1/ncs-nrfx-pwm-simple-example/blob/master/src/main.c&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I expect you&amp;nbsp;need to add the pwm callback to the nrfx_pwm_init, e.g.:&lt;/p&gt;
&lt;p&gt;irq_enable(PWM1_IRQn);&lt;/p&gt;
&lt;p&gt;nrfx_pwm_init(&amp;amp;my_pwm, &amp;amp;config0, pwm_isr_handler,&amp;nbsp;NULL);&lt;/p&gt;
&lt;p&gt;ISR_DIRECT_DECLARE(pwm_isr_handler)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;nrfx_pwm_irq_handler();&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;ISR_DIRECT_PM();&amp;nbsp;&lt;br /&gt;}&lt;br /&gt;void&amp;nbsp;nrfx_pwm_irq_handler() {&lt;br /&gt;...&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;if&amp;nbsp;(nrf_pwm_event_check(NRF_PWM1,&amp;nbsp;NRF_PWM_EVENT_PWMPERIODEND)) {&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;nrf_pwm_event_clear(NRF_PWM1,&amp;nbsp;NRF_PWM_EVENT_PWMPERIODEND);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Not tested, but something like that,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>