<?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>Periodic current spikes on sleep</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69557/periodic-current-spikes-on-sleep</link><description>I&amp;#39;m measuring the current of the following code: 
 
 I&amp;#39;m not using softdevices. 
 I have nothing more connected to the board than the power. 
 I measure about 0.320 uA which is good, I think... but I got periodic 100uA current spikes every 70ms which</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 16 Dec 2020 19:02:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69557/periodic-current-spikes-on-sleep" /><item><title>RE: Periodic current spikes on sleep</title><link>https://devzone.nordicsemi.com/thread/285448?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2020 19:02:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcab660d-c3e2-42c5-a0e1-ecd514d3bf11</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Probably due to an anomaly workaround see&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52810_Rev2%2FERR%2FnRF52810%2FRev2%2Flatest%2Ferr_810.html"&gt;errata_nRF52810_Rev2&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic current spikes on sleep</title><link>https://devzone.nordicsemi.com/thread/285437?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2020 16:45:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:474d8348-455a-4dbc-a9dd-d975dbef757f</guid><dc:creator>kammutierspule</dc:creator><description>&lt;p&gt;I tried it but it looks to be to other nRF52 version? this one does not has&amp;nbsp;NRF_MWU&lt;br /&gt;Mine is&amp;nbsp;nRF52810 using a module from Nordicsemi&amp;#39;s 3rd part list. I have nothing more conected.&lt;br /&gt;&lt;br /&gt;I tried some lines from your code, except&amp;nbsp;what was inside the&amp;nbsp;MWU_AccessWatchMask&lt;/p&gt;
&lt;p&gt;This 5.8uA average I&amp;#39;m getting, are just because I enabled the lfclk by calling the&amp;nbsp;nrfx_clock_lfclk_start&lt;/p&gt;
&lt;p&gt;I just found something, if I call this function&lt;br /&gt;nrfx_clock_lfclk_start();&amp;nbsp; &amp;lt;- this consumes 5.8uA average&lt;/p&gt;
&lt;p&gt;if instead I call this function to active the LFCLK&amp;nbsp;&lt;br /&gt; nrf_clock_task_trigger(NRF_CLOCK_TASK_LFCLKSTART); &amp;lt;-- this works and only consumes 1.48uA average, so, match the datasheet&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The problem is on&amp;nbsp;&lt;span&gt;nrfx_clock_lfclk_start why?!&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic current spikes on sleep</title><link>https://devzone.nordicsemi.com/thread/285207?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2020 03:20:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae3792f0-53d8-4874-946e-5af5dc099be8</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Well .. two things; first running any additional code means that capacitor on the LDO discharges quicker so pulse rate increases and second .. hmm, you might not want this but:&lt;/p&gt;
&lt;p&gt;Try replacing the WFE stuff you have with this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    // Errata 220: CPU: RAM is not ready when written - Disable IRQ while using WFE
    // Symptoms - Memory is not written in the first cycle after wake-up
    // Consequences - The address of the next instruction is not written to the stack. In stack frame, the link register is corrupted
    // Workaround
    // ==========
    // Enable SEVONPEND to disable interrupts so the internal events that generate the interrupt cause wakeuup in __WFE context and not in interrupt context
    // Before: ENABLE_WAKEUP_SOURCE -&amp;gt; __WFE -&amp;gt; WAKEUP_SOURCE_ISR -&amp;gt; CONTINUE_FROM_ISR  next line of __WFE
    // After:  ENABLE_WAKEUP_SOURCE -&amp;gt; SEVONPEND -&amp;gt; DISABLE_INTERRUPTS -&amp;gt; __WFE -&amp;gt; WAKEUP inside __WFE -&amp;gt; ENABLE_interrupts -&amp;gt; WAKEUP_SOURCE_ISR
    // Applications must not modify the SEVONPEND flag in the SCR register when running in priority levels higher than 6 (priority level numerical
    // values lower than 6) as this can lead to undefined behavior with SoftDevice enabled
    //
    // Errata 75: MWU: Increased current consumption
    // This has to be handled by turning off MWU but it is used in SoftDevice
    // see https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52832_EngB%2FERR%2FnRF52832%2FEngineeringB%2Flatest%2Fanomaly_832_75.html
    //
    // Errata 220: Enable SEVONPEND
    SCB-&amp;gt;SCR |= SCB_SCR_SEVONPEND_Msk;
    __disable_irq();
    // Errata 75: MWU Disable
    uint32_t MWU_AccessWatchMask = NRF_MWU-&amp;gt;REGIONEN &amp;amp; MWU_ACCESS_WATCH_MASK;
    // Handle MNU if any areas are enabled
    if (MWU_AccessWatchMask)
    {
        NRF_MWU-&amp;gt;REGIONENCLR = MWU_AccessWatchMask; // Disable write access watch in region[0] and PREGION[0]
        __WFE();
        __NOP(); __NOP(); __NOP(); __NOP();
        // Errata 75: MWU Enable
        NRF_MWU-&amp;gt;REGIONENSET = MWU_AccessWatchMask;
    }
    else
    {
        __WFE();
        __NOP(); __NOP(); __NOP(); __NOP();
    }
    __enable_irq();
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;One assumes nothing is connected to any of the output pins? And yes I know you are not setting them in main() above. What type of capacitors are on the board?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic current spikes on sleep</title><link>https://devzone.nordicsemi.com/thread/285205?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2020 02:42:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15d37bad-01cf-47e6-a1f4-5a4a0b39d5d2</guid><dc:creator>kammutierspule</dc:creator><description>&lt;p&gt;I understand, thanks!&lt;br /&gt;However, I&amp;#39;ve now added RTC to wakeup from sleep, and the frequency of the spikes increased, so it gets one 100uA spike every 8ms .. 10ms.&lt;br /&gt;That gives me an average current of 5.7uA, that is much more than the 1.5uA from the datasheet (1.5uA)for RTC enabled.&lt;br /&gt;I&amp;#39;m using 3.3V and internal LFRC&lt;br /&gt;Any idea what is giving me higher current?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periodic current spikes on sleep</title><link>https://devzone.nordicsemi.com/thread/285202?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2020 01:40:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c6474b2-c9b5-4d28-9678-b50750f6739e</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;It might be about skipping .. since you didn&amp;#39;t enable the DCDC the LDO is the default:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;em&gt;Refresh mode is not the same as DCDC. The refresh mode is only in use when the device is on it&amp;#39;s lowest power state and barely &amp;quot;kept alive&amp;quot;. The way it works is that you have a capacitor that is charged quickly with a short pulse. The regulator senses the voltage on the cap and gives another pulse when the voltage drops below the threshold. This gives quite a lot of ripple on the regulator output but that doesn&amp;#39;t matter as none of the power critical parts are on anyway. So you sacrifice ripple and load regulation for better efficiency&lt;/em&gt;.&amp;quot;&lt;/p&gt;
&lt;p&gt;Have a look at this thread:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/62526/11ua-to-30-ua-low-power-pulses-at-4ms-intervals"&gt;low-power-pulses&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is slightly unusual behaviour for an LDO regulator; I wasn&amp;#39;t expecting it either but it is beneficial in terms of overall battery life&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>