<?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>High Current Draw With Floating Point Calculation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23576/high-current-draw-with-floating-point-calculation</link><description>I&amp;#39;m attempting to optimize our application for battery life on the nrf52832. 
 If I execute a floating point calculation to rescale RGB to PWM, I start drawing 6.2mA, eliminating the calculation reduces current to an more reasonable 0.05mA.
To be clear</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Sep 2018 15:15:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23576/high-current-draw-with-floating-point-calculation" /><item><title>RE: High Current Draw With Floating Point Calculation</title><link>https://devzone.nordicsemi.com/thread/150101?ContentTypeID=1</link><pubDate>Mon, 24 Sep 2018 15:15:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79194835-cdfb-4c3a-bc6f-d067a012950d</guid><dc:creator>Marten</dc:creator><description>&lt;p&gt;Just saw that the fix is also used when calling nrf_pwr_mgmt_run() (in nrf_pwr_mgmt.c)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;__STATIC_INLINE void pwr_mgmt_fpu_sleep_prepare(void)
{
    uint32_t fpscr;
    CRITICAL_REGION_ENTER();
    fpscr = __get_FPSCR();
    /*
    * Clear FPU exceptions.
    * Without this step, the FPU interrupt is marked as pending,
    * preventing system from sleeping. Exceptions cleared:
    * - IOC - Invalid Operation cumulative exception bit.
    * - DZC - Division by Zero cumulative exception bit.
    * - OFC - Overflow cumulative exception bit.
    * - UFC - Underflow cumulative exception bit.
    * - IXC - Inexact cumulative exception bit.
    * - IDC - Input Denormal cumulative exception bit.
    */
    __set_FPSCR(fpscr &amp;amp; ~0x9Fu);
    __DMB();
    NVIC_ClearPendingIRQ(FPU_IRQn);
    CRITICAL_REGION_EXIT();

    /*
    * Assert no critical FPU exception is signaled:
    * - IOC - Invalid Operation cumulative exception bit.
    * - DZC - Division by Zero cumulative exception bit.
    * - OFC - Overflow cumulative exception bit.
    */
    ASSERT((fpscr &amp;amp; 0x07) == 0);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Current Draw With Floating Point Calculation</title><link>https://devzone.nordicsemi.com/thread/92626?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2017 19:35:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bbc9cd3-2017-49fb-8b06-3ad4e6c6e9f7</guid><dc:creator>Ken</dc:creator><description>&lt;p&gt;That fixed the issue.
Thank-you
ken&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Current Draw With Floating Point Calculation</title><link>https://devzone.nordicsemi.com/thread/92625?ContentTypeID=1</link><pubDate>Mon, 17 Jul 2017 15:04:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2de68d24-b6cd-4acb-8f42-d56a492a3885</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Make sure you have implemented the workaround for &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.Rev1.errata/anomaly_832_87.html?cp=2_1_1_0_1_24"&gt;PAN-87 - CPU: Unexpected wake from System ON Idle when using FPU&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>