<?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>nRF52832 Timer interrupt not working</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30465/nrf52832-timer-interrupt-not-working</link><description>Hi, 
 I cannot get the interrupt on Timer1 to work. I have checked that the counter is matching the compare register by not enabling the interrupt. When I enable the interrupt the LED is never set. 
 I&amp;#39;m using the nRF52832 with SD132 and nRF5 SDK v11</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Jan 2019 10:26:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30465/nrf52832-timer-interrupt-not-working" /><item><title>RE: nRF52832 Timer interrupt not working</title><link>https://devzone.nordicsemi.com/thread/165114?ContentTypeID=1</link><pubDate>Fri, 11 Jan 2019 10:26:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a47197f2-df57-4067-9a8d-4ad340765eff</guid><dc:creator>Meera Shah</dc:creator><description>&lt;p&gt;I got error of multiple definition error of&amp;nbsp;TIMER1_IRQHandler&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 Timer interrupt not working</title><link>https://devzone.nordicsemi.com/thread/120761?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2018 21:24:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0489abaf-6e9a-4102-8281-267f28c56e89</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Try this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;quot;nrf_drv_timer.h&amp;quot;
#include &amp;quot;nrf52.h&amp;quot;
#include &amp;quot;nrf_gpio.h&amp;quot;

#define RED_LED_PIN 17 // LED1 on nRF52-DK

void TIMER1_IRQHandler(void)
{
    if(NRF_TIMER1-&amp;gt;EVENTS_COMPARE[0] == 1)
    {
        NRF_TIMER1-&amp;gt;EVENTS_COMPARE[0] = 0;
        nrf_gpio_pin_toggle(RED_LED_PIN);    
    }
}

int main()
{
    // Output LED pin
    nrf_gpio_pin_clear(RED_LED_PIN);
    nrf_gpio_cfg_output(RED_LED_PIN);

    //Enable ~1sec timer 
    NVIC_DisableIRQ(TIMER1_IRQn); // use &amp;quot;sd_nvic&amp;quot; prefix with softdevice
    
    nrf_timer_task_trigger(NRF_TIMER1, NRF_TIMER_TASK_STOP);
    nrf_timer_task_trigger(NRF_TIMER1, NRF_TIMER_TASK_CLEAR);
    
    nrf_timer_mode_set(NRF_TIMER1, NRF_TIMER_MODE_TIMER); 
    nrf_timer_bit_width_set(NRF_TIMER1, NRF_TIMER_BIT_WIDTH_32);
    nrf_timer_frequency_set(NRF_TIMER1, NRF_TIMER_FREQ_31250Hz);
    nrf_timer_cc_write(NRF_TIMER1, NRF_TIMER_CC_CHANNEL0, 31250);
    nrf_timer_int_enable(NRF_TIMER1, NRF_TIMER_INT_COMPARE0_MASK);
    nrf_timer_shorts_enable(NRF_TIMER1, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK); // self running
    
    NVIC_SetPriority(TIMER1_IRQn, 7); // use &amp;quot;sd_nvic&amp;quot; prefix with softdevice
    NVIC_EnableIRQ(TIMER1_IRQn); // use &amp;quot;sd_nvic&amp;quot; prefix with softdevice

    nrf_timer_task_trigger(NRF_TIMER1, NRF_TIMER_TASK_START);

    while(1)
    {
    } 
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>