<?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>TIMER INTERRUPT CALL BACK NOT CALLED AFTER FIRST TIME EXECUTION.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40156/timer-interrupt-call-back-not-called-after-first-time-execution</link><description>Hi, 
 I am woking on NRF52840. 
 OS : Windows 
 SDK version : 15.0 
 Dev : Keil IDE. 
 
 I am using Timer -2, Compare value method to obtain an interrupt. 
 The interrupt is being generated every time but the call back is executed only on the first interrupt</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Nov 2018 11:40:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40156/timer-interrupt-call-back-not-called-after-first-time-execution" /><item><title>RE: TIMER INTERRUPT CALL BACK NOT CALLED AFTER FIRST TIME EXECUTION.</title><link>https://devzone.nordicsemi.com/thread/156135?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2018 11:40:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7f6d0ee-8d85-4b16-b754-ef8062e236cd</guid><dc:creator>TEJASWINI J</dc:creator><description>&lt;p&gt;Thank You! :) It worked :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TIMER INTERRUPT CALL BACK NOT CALLED AFTER FIRST TIME EXECUTION.</title><link>https://devzone.nordicsemi.com/thread/155938?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 12:13:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3d39671-3bde-47c0-ab94-ee253386f738</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Using&amp;nbsp;&lt;span&gt;NRF_TIMER_SHORT_COMPARE1_STOP_MASK stops your timer after the compare event so that won&amp;#39;t work. You should rather use&amp;nbsp;&lt;/span&gt;NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I copied your code, commented out the GPIOTE and SPIM stuff, and used&amp;nbsp;&lt;span&gt;_CLEAR_MASK instead of&amp;nbsp;_STOP_MASK and it seems to work like intended. Maybe you should try that too and focus on getting the timer to work before you include the other peripherals. If it doesn&amp;#39;t work, can you upload your project files?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void event_handler(nrf_timer_event_t event_type, void * p_context)
{
    //
}

void test(void)
{
    nrf_ppi_channel_t m_ppi_channel;
    uint32_t err_code;

    const nrfx_timer_t m_timer2 = NRF_DRV_TIMER_INSTANCE(2);

    /* Timer Init */

    nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    err_code = nrf_drv_timer_init( &amp;amp;m_timer2, &amp;amp;timer_cfg, event_handler);
    APP_ERROR_CHECK( err_code );

    /* PPI Init */

    // Configuring the PPI used for automating the data streaming
    err_code = nrf_drv_ppi_channel_alloc( &amp;amp;m_ppi_channel );
    APP_ERROR_CHECK( err_code );

    // Set up PPI Chn0 for triggering of SPIM start when DR pin event occurs (set up for falling edge event)
//    err_code = nrf_drv_ppi_channel_assign( m_ppi_channel,
//    nrf_drv_gpiote_in_event_addr_get( AFE_DR_PIN ),
//    nrf_spim_task_address_get( nrfbusHandle-&amp;gt;busIdentifier.u.spim.p_reg, NRF_SPIM_TASK_START ) );
//    APP_ERROR_CHECK( err_code );

    // Fork PPI to also trigger count on timer2 to keep track of number of samples.
    err_code = nrf_drv_ppi_channel_fork_assign( m_ppi_channel, nrf_drv_timer_task_address_get( &amp;amp;m_timer2, NRF_TIMER_TASK_COUNT ) );
    APP_ERROR_CHECK( err_code );

    /* Waiting for INT */

    nrf_drv_timer_extended_compare( &amp;amp;m_timer2, NRF_TIMER_CC_CHANNEL1,1000, NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK, true ); //Tried with clear mask also

    err_code = nrf_drv_ppi_channel_enable( m_ppi_channel );
    APP_ERROR_CHECK( err_code );

    nrf_drv_timer_enable( &amp;amp;m_timer2 );
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TIMER INTERRUPT CALL BACK NOT CALLED AFTER FIRST TIME EXECUTION.</title><link>https://devzone.nordicsemi.com/thread/155880?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2018 08:48:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e03cebc1-5131-42a3-82ed-d88ea340445b</guid><dc:creator>TEJASWINI J</dc:creator><description>&lt;p&gt;Just to add a little more to this,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The Timer IRQ itself is not firing after the first time&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>