<?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>Capture a Timer Compare Register during the interrupt of another</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65437/capture-a-timer-compare-register-during-the-interrupt-of-another</link><description>I am working with the nRF52840 DK and was looking for a way to set a compare register to trigger at 300 ticks, and another to trigger at 40000 ticks. The register that triggers at 300 ticks should trigger an interrupt where I want to grab the current</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 01 Sep 2020 08:10:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65437/capture-a-timer-compare-register-during-the-interrupt-of-another" /><item><title>RE: Capture a Timer Compare Register during the interrupt of another</title><link>https://devzone.nordicsemi.com/thread/267378?ContentTypeID=1</link><pubDate>Tue, 01 Sep 2020 08:10:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5436bf6b-6efd-470f-9018-054be31b3dd2</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This line in your code is causing the timer register to be cleared when you reach COMPARE0 (which happens at the tick count set in CC[0]):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;FREE_TIMER-&amp;gt;SHORTS      = TIMER_SHORTS_COMPARE0_CLEAR_Msk;                          // Make sure the timer clears after reaching CC[0]&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you want the timer to restart after CC[1], you can use&amp;nbsp;COMPARE1_CLEAR short.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>