<?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>How to disable a timer IRQ</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/732/how-to-disable-a-timer-irq</link><description>Hi! 
 I know this might be a stupid question to you but still... I am not able to disable i.e. a timer0 cc(3) IRQ. 
 My way to enable it in first place: 
 NRF_TIMER0-&amp;gt;INTENSET = (TIMER_INTENSET_COMPARE3_Enabled &amp;lt;&amp;lt; TIMER_INTENSET_COMPARE3_Pos);
 </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Oct 2013 11:32:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/732/how-to-disable-a-timer-irq" /><item><title>RE: How to disable a timer IRQ</title><link>https://devzone.nordicsemi.com/thread/3718?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2013 11:32:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2ee1d77-5893-4674-b64f-dd84b2cd0f45</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I&amp;#39;m not able to replicate your problem, and as far as I can see, your line works as expected. I did a quick modification to ble_app_template to test it, since it already has the setup needed to do button handling. Since the softdevice is enabled, I had to use TIMER1, but these registers should be equal on all timers.&lt;/p&gt;
&lt;p&gt;I used the following code to set things up:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
    NRF_TIMER1-&amp;gt;CC[0] = 65535;
    NRF_TIMER1-&amp;gt;SHORTS = TIMER_SHORTS_COMPARE0_CLEAR_Enabled &amp;lt;&amp;lt; TIMER_SHORTS_COMPARE0_CLEAR_Pos;
    NRF_TIMER1-&amp;gt;INTENSET = TIMER_INTENSET_COMPARE0_Enabled &amp;lt;&amp;lt; TIMER_INTENSET_COMPARE0_Pos;
    
    NRF_TIMER1-&amp;gt;PRESCALER = 4;
    
    err_code = sd_nvic_SetPriority(TIMER1_IRQn, APP_IRQ_PRIORITY_LOW);
    APP_ERROR_CHECK(err_code);
    
    err_code = sd_nvic_EnableIRQ(TIMER1_IRQn);
    APP_ERROR_CHECK(err_code);
    
    NRF_TIMER1-&amp;gt;TASKS_START = 1;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and then, when pressing button 1, I do&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
NRF_TIMER1-&amp;gt;INTENCLR = TIMER_INTENCLR_COMPARE0_Clear &amp;lt;&amp;lt; TIMER_INTENCLR_COMPARE0_Pos;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(The _Clear value is the same as the _Enable, it&amp;#39;s just that I think it reads better when looking at the code.)&lt;/p&gt;
&lt;p&gt;This makes TIMER1_IRQHandler stop firing, as expected. If you still have trouble, could you please share your complete code?&lt;/p&gt;
&lt;p&gt;In general, the -SET and -CLR pattern is described in section 9.1.2 in the Reference Manual:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Registers with multiple single-bit bit-fields may implement the “set and clear” pattern. This pattern enables
firmware to set and clear individual bits in a register without having to perform a read-modify-write operation on the main register. This pattern is implemented using three consecutive addresses in the register map where the main register is followed by a dedicated SET and CLR register in that order. The SET register is used to set individual bits in the main register while the CLR register is used to clear individual bits in the main register. Writing a ‘1’ to a bit in the SET or CLR register will set or clear the same bit in the main register respectively. Reading the SET or CLR registers returns the value of the main register.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Edit: Attach the main file I used for testing.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3660.main.c"&gt;main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>