<?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>Timer0 interrupt only firing once on nRF52832 using nrfx sdk - how to re-enable in ISR?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/120442/timer0-interrupt-only-firing-once-on-nrf52832-using-nrfx-sdk---how-to-re-enable-in-isr</link><description>Hi, 
 
 With the attached code, the timer0_event_handler() is only called once - is there something else I need to do in the ISR or at initialisation-time to ensure that it fires repeatedly?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Apr 2025 08:53:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/120442/timer0-interrupt-only-firing-once-on-nrf52832-using-nrfx-sdk---how-to-re-enable-in-isr" /><item><title>RE: Timer0 interrupt only firing once on nRF52832 using nrfx sdk - how to re-enable in ISR?</title><link>https://devzone.nordicsemi.com/thread/530568?ContentTypeID=1</link><pubDate>Fri, 04 Apr 2025 08:53:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c6d71bb-7d5c-48d4-9b55-ae20416a14b9</guid><dc:creator>Matt_V</dc:creator><description>&lt;p&gt;I do need to do app-specific things in the ISR though (I&amp;#39;ve just left them out of the code I posted, for conciseness and confidentiality) .&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The lines:&lt;br /&gt;nrfx_timer_clear(&amp;amp;m_timer0);&lt;br /&gt;nrfx_timer_enable(&amp;amp;m_timer0);&lt;br /&gt;I only added these two lines when the ISR failed to work more than once initially - but this didn&amp;#39;t help.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer0 interrupt only firing once on nRF52832 using nrfx sdk - how to re-enable in ISR?</title><link>https://devzone.nordicsemi.com/thread/530509?ContentTypeID=1</link><pubDate>Thu, 03 Apr 2025 18:44:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c44b3a0-f519-4b7e-8966-534b3df807b9</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;SHORTS as set in the code above clears the timer on compare 0 and leaves it running so isr shouldn&amp;#39;t redundantly clear or attempt to enable; if the isr is required simply do this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void timer0_event_handler(nrf_timer_event_t event_type, void * p_context)
{
   static uint32_t state = 0;

//   nrfx_timer_clear(&amp;amp;m_timer0);
//   nrfx_timer_enable(&amp;amp;m_timer0);
...
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer0 interrupt only firing once on nRF52832 using nrfx sdk - how to re-enable in ISR?</title><link>https://devzone.nordicsemi.com/thread/530508?ContentTypeID=1</link><pubDate>Thu, 03 Apr 2025 17:50:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c48ea802-8828-405b-a1c3-08df2049ba9b</guid><dc:creator>Matt_V</dc:creator><description>&lt;p&gt;I need the ISR to perform an application specific action though.&amp;nbsp; What&amp;#39;s SHORTS, btw?&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer0 interrupt only firing once on nRF52832 using nrfx sdk - how to re-enable in ISR?</title><link>https://devzone.nordicsemi.com/thread/530507?ContentTypeID=1</link><pubDate>Thu, 03 Apr 2025 17:47:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe383f9d-c068-4e4d-8605-1cb4e0b5ebd4</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Don&amp;#39;t need the isr as the SHORTS handles the clear and leaves timer running, try getting rid of it:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    ret_code_t err_code = nrfx_timer_init(&amp;amp;m_timer0, &amp;amp;timer_cfg, NULL); &amp;lt;&amp;lt;==
    APP_ERROR_CHECK(err_code);

    nrfx_timer_extended_compare(&amp;amp;m_timer0,
                                NRF_TIMER_CC_CHANNEL0,
                                nrfx_timer_ms_to_ticks(&amp;amp;m_timer0,
                                                       TIMER0_INTERVAL),
                                NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK,
                                false);   &amp;lt;&amp;lt;==
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>