<?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>App timer high current consumption</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29309/app-timer-high-current-consumption</link><description>I have a need for an interrupt to go off at a 4khz rate. For this, I am using a repeated App Timer (running off the 32k crystal). 
 Prior to adding this extra timer, we used to have a power consumption of about 60ua. If I enable the timer to run at 4khz</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 10 Jan 2018 15:36:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29309/app-timer-high-current-consumption" /><item><title>RE: App timer high current consumption</title><link>https://devzone.nordicsemi.com/thread/116609?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2018 15:36:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c37b685a-b729-4abf-b47c-18f03f326a32</guid><dc:creator>AmbystomaLabs</dc:creator><description>&lt;p&gt;What I had implied in my comment was that you cannot do what you are proposing.&lt;/p&gt;
&lt;p&gt;The SD always has highest priority in the system.  So just advertising beacons alone keep you locked out of the processor for about 700usec a little before and during beacon intervals. If you are actually in a connection and transferring data then this latency just gets worse.&lt;/p&gt;
&lt;p&gt;This latency alone is nearly 3 cycles of your 4kHz clock which guarantees 3 interrupts will get queued and serviced late periodically. Finally when you consider that just servicing an empty handler requires a few opcodes and putting the processor back into power manage is probably a few dozen more you will realize you are asking the processor to do quite a bit every millisecond.&lt;/p&gt;
&lt;p&gt;The only way to implement kHz timing of anything is ppi/gpiote. Just search the devzone on how to do this.  It is a common question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer high current consumption</title><link>https://devzone.nordicsemi.com/thread/116608?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2018 10:41:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d2e9c4e-1cd4-4c2c-b9fd-3b5d4f4db979</guid><dc:creator>cirlam</dc:creator><description>&lt;p&gt;The other app timers are comparatively slow:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1 triggers every second&lt;/li&gt;
&lt;li&gt;another every 30 seconds&lt;/li&gt;
&lt;li&gt;another the moment before the RTC overflows&lt;/li&gt;
&lt;li&gt;then there
are 2 single shot timers which are
only used during the start of the
program.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;My main loop consists of a while loop which puts the device back into power manage unless I have set a flag which then requires it to step out of the while loop and do some additional work (this typically happens every 0.3 seconds currently).
There will be some calculations occurring within the timer interrupt routine, so unfortunately PPI isn&amp;#39;t a viable option.&lt;/p&gt;
&lt;p&gt;We have checked the data sheet and the wake up time from idle advertised in the data sheet suggests this should be doable at low power - however I suspect the data sheet is for the raw device, not when the soft device is running as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer high current consumption</title><link>https://devzone.nordicsemi.com/thread/116607?ContentTypeID=1</link><pubDate>Tue, 09 Jan 2018 16:12:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ad7453f-b3d8-439f-b233-0097abdbdbf0</guid><dc:creator>AmbystomaLabs</dc:creator><description>&lt;p&gt;The question that comes to mind is, &amp;quot;what was the period of your other app timers?&amp;quot;
4kHz is pretty fast for an interrupt rate.  Every time the interrupt happens the processor has a lot of work to do even if nothing is in the handler.  Also, since this pulls it out of power manage main runs until it starts power manage again. So you could have a lot of code running in main.&lt;/p&gt;
&lt;p&gt;You should be careful trying to have so many ISR&amp;#39;s with the SD running. Unless you use timeslotting there is no coordination between the SD and your code so your ISR&amp;#39;s will occasionally be delayed and queued.&lt;/p&gt;
&lt;p&gt;If your 4kHz is just toggling gpio or causing a comms task to run that has DMA then instead use ppi/gpiote to trigger the task and keep it out of code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>