<?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>Soft Device and Timers - how do they work together?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1160/soft-device-and-timers---how-do-they-work-together</link><description>Hi all,
I&amp;#39;m using Timer2 while having the SD enabled, and I&amp;#39;m having some problems. I don&amp;#39;t seem to be able to reliably set the periodicity of the timer. No matter what I load in the CC[] register, the interrupt always triggers at the same frequency</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 12 Jun 2015 06:39:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1160/soft-device-and-timers---how-do-they-work-together" /><item><title>RE: Soft Device and Timers - how do they work together?</title><link>https://devzone.nordicsemi.com/thread/5441?ContentTypeID=1</link><pubDate>Fri, 12 Jun 2015 06:39:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1915f393-46a0-49a3-9d73-de863d67350f</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;why so!?
I need to have 1ms timer-1 interrupt in ble_uart  application.
Is is possible?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device and Timers - how do they work together?</title><link>https://devzone.nordicsemi.com/thread/5443?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2014 10:36:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15e84e38-cf4e-4deb-aba4-7061e0e99be0</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry for the extremely long delay in answering this, but I believe Anders is spot on on his recommendation here; use a shortcut between your COMPARE event and the CLEAR task to make sure that the timer is always cleared before you start over again.&lt;/p&gt;
&lt;p&gt;Also, remember that TIMER2 only is a 8/16 bit timer, so if you try to set the CC value to something bigger than 65535, you will see very weird timeouts. As Anders also says, you should be aware that the PRESCALER register is defined so that the frequency of the timer is 16 MHz / 2^PRESCALER. As you can see, if you need a 1 MHz timer you must set this register to 4.&lt;/p&gt;
&lt;p&gt;If you still have trouble, can you please share your complete code, so that I can test it here? That makes it so much easier to help you. If you can&amp;#39;t share it here in the open, feel free to create a support case for it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device and Timers - how do they work together?</title><link>https://devzone.nordicsemi.com/thread/5442?ContentTypeID=1</link><pubDate>Wed, 15 Jan 2014 18:17:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b253740-f5f2-4bef-8133-1ca878e507ed</guid><dc:creator>Gil dePaula</dc:creator><description>&lt;p&gt;Thank you Anders!&lt;/p&gt;
&lt;p&gt;I will try that.&lt;/p&gt;
&lt;p&gt;I also had to use:
hb_timer-&amp;gt;TASKS_CLEAR = 1;
in the interrupt handler to make it work more reliably.&lt;/p&gt;
&lt;p&gt;Gil&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device and Timers - how do they work together?</title><link>https://devzone.nordicsemi.com/thread/5439?ContentTypeID=1</link><pubDate>Wed, 15 Jan 2014 16:13:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be89ec61-9c17-4bac-9763-134d2caf2d3f</guid><dc:creator>Anders Nore</dc:creator><description>&lt;p&gt;If you want to trigger the timer periodically with a given frequency, you can use shortcuts to clear the timer when getting a compare event.&lt;/p&gt;
&lt;p&gt;For instance, if you insert this before starting the timer:&lt;/p&gt;
&lt;p&gt;NRF_TIMER2-&amp;gt;SHORTS = (TIMER_SHORTS_COMPARE0_CLEAR_Enabled &amp;lt;&amp;lt; TIMER_SHORTS_COMPARE0_CLEAR_Pos) &amp;amp; TIMER_SHORTS_COMPARE0_CLEAR_Msk;&lt;/p&gt;
&lt;p&gt;The timer should count up to the value in NRF_TIMER2-&amp;gt;CC[0], then it will give the compare event, clear the internal counter and start again.&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t have this shortcut, then the timer will simply wrap around and give a frequency depending on the width of the CC register (which is 16bit in this case). Changing the CC will then only change when you get the first compare event.&lt;/p&gt;
&lt;p&gt;Sidenote, PRESCALER of 0 is not 1MHz, it&amp;#39;s 16MHz. To get a 1MHz timer, use a prescaler of 4.&lt;/p&gt;
&lt;p&gt;-Anders&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device and Timers - how do they work together?</title><link>https://devzone.nordicsemi.com/thread/5440?ContentTypeID=1</link><pubDate>Wed, 18 Dec 2013 01:16:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fc6b057-b2c3-4153-855c-95736daf52f9</guid><dc:creator>Gil dePaula</dc:creator><description>&lt;p&gt;Some more information:&lt;/p&gt;
&lt;p&gt;When the timer is running our device will not be advertising nor connected.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device and Timers - how do they work together?</title><link>https://devzone.nordicsemi.com/thread/5438?ContentTypeID=1</link><pubDate>Wed, 18 Dec 2013 00:14:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4590a2c9-055c-4363-b608-17efa727a488</guid><dc:creator>Gil dePaula</dc:creator><description>&lt;p&gt;In other words, I change &amp;quot;delay&amp;quot; but the frequency is still the same.  I doesn&amp;#39;t make sense.  What am I doing wrong?&lt;/p&gt;
&lt;p&gt;Thank you!
Gil&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>