<?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>NRF52840 Timer channels with different periods.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91552/nrf52840-timer-channels-with-different-periods</link><description>Hi There, 
 
 I have been looking for ways to have three channels of a hardware timer with the NRF52840 generate a compare interrupt at different time intervals, my understanding is that this is their functionality however I have not been able to implement</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 01 Sep 2022 20:36:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91552/nrf52840-timer-channels-with-different-periods" /><item><title>RE: NRF52840 Timer channels with different periods.</title><link>https://devzone.nordicsemi.com/thread/384381?ContentTypeID=1</link><pubDate>Thu, 01 Sep 2022 20:36:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39db5252-4fe1-4b22-8cd8-17f33c8b7573</guid><dc:creator>  Curiosus</dc:creator><description>[quote userid="15146" url="~/f/nordic-q-a/91552/nrf52840-timer-channels-with-different-periods/384323"]&amp;nbsp;&lt;span&gt;nrfx_timer_clear()&lt;/span&gt;[/quote]
&lt;p&gt;That is it , thanks for the quick response !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 Timer channels with different periods.</title><link>https://devzone.nordicsemi.com/thread/384323?ContentTypeID=1</link><pubDate>Thu, 01 Sep 2022 11:54:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00fd3952-c5f7-46d1-95fe-659f280833f3</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When you get the last interrupt, call&amp;nbsp;&lt;span&gt;nrfx_timer_clear(), the timer will then &amp;#39;restart&amp;#39; from the begin,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Alternatively&lt;span&gt;, when you set up the last compare interrupt, use the function&amp;nbsp;nrfx_timer_extended_compare() with a &amp;#39;short mask&amp;#39; between the compare and the clear timer task&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &lt;pre class="ui-code" data-mode="text"&gt;nrfx_timer_extended_compare(&amp;amp;timer,
NRF_TIMER_CC_CHANNEL2,
nrfx_timer_ms_to_ticks(&amp;amp;timer, delay_ms),
NRF_TIMER_SHORT_COMPARE2_CLEAR_MASK, //Shortcut for clearing the timer based on compare 2.
true);&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>