<?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>Issue setting up timer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67311/issue-setting-up-timer</link><description>Hey, I&amp;#39;m trying to set up a simple timer that fires an interrupt every so often (100-200ms), but I&amp;#39;m having trouble. My interrupt keeps firing continuously, but I think I&amp;#39;m clearing the compare event. 
 
 Here is my code:</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Oct 2020 20:09:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67311/issue-setting-up-timer" /><item><title>RE: Issue setting up timer</title><link>https://devzone.nordicsemi.com/thread/276509?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2020 20:09:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d8ed3f5-fd14-460d-9da2-9cb66a29718e</guid><dc:creator>freelon</dc:creator><description>&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue setting up timer</title><link>https://devzone.nordicsemi.com/thread/275594?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2020 11:44:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdc0c3ab-ed53-414b-8b6f-0799ff56bc9e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Looks like you are clearing the event correctly, but maybe forgetting the counter register. In that case the timer will keep incrementing after the CC[1] compare match event until it eventually overflows and starts over. I suggest you try to enabling the compare_clear shortcut to automatically restart the timer on compare match.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main() 
{
    nrf_timer_shorts_enable(NRF_TIMER4, TIMER_SHORTS_COMPARE1_CLEAR_Msk);
    nrf_timer_mode_set(NRF_TIMER4, NRF_TIMER_MODE_TIMER);
    ...&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>