<?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>How to optimize the power consumption of a simple Broadcaster ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37294/how-to-optimize-the-power-consumption-of-a-simple-broadcaster</link><description>Hello Nordic support team, I broadcast data each 1 second and I use the following function (as used in many examples) to manage the power consumption. Unfortunately, I measure a consumption of 3mA between each data packet transmitted. I expected that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Aug 2018 14:11:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37294/how-to-optimize-the-power-consumption-of-a-simple-broadcaster" /><item><title>RE: How to optimize the power consumption of a simple Broadcaster ?</title><link>https://devzone.nordicsemi.com/thread/143605?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 14:11:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62101ddd-9f04-4ac2-bf87-9a8debede017</guid><dc:creator>Sylvain</dc:creator><description>&lt;p&gt;Thanks for the support Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to optimize the power consumption of a simple Broadcaster ?</title><link>https://devzone.nordicsemi.com/thread/143602?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 14:05:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edeb65fa-94e9-4b6b-a6db-a1f257524b52</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. Then this is definitely the due to the FPU event keeping the CPU awake. You need to clear the FPU event before entering sleep, as indicated in my previous (updated) post.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to optimize the power consumption of a simple Broadcaster ?</title><link>https://devzone.nordicsemi.com/thread/143598?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 13:54:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0180cef5-b132-48c8-bc25-aade9d9a7218</guid><dc:creator>Sylvain</dc:creator><description>&lt;p&gt;I don&amp;#39;t use CAYENNE_LPP_FRAME in this code, it can be removed. The only problem is the storage of the float variable &amp;quot;temperature&amp;quot; into the integer variable &amp;quot;int_temperature&amp;quot;. That stays very very strange ...&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;//Global variable
float temperature = 24.6;

main
{
    int int_temperature = (int)(temperature*10);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to optimize the power consumption of a simple Broadcaster ?</title><link>https://devzone.nordicsemi.com/thread/143590?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 13:30:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2077eab5-6079-41a1-a1ac-9fb60b8b7541</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;*Updated*&lt;/p&gt;
&lt;p&gt;The problem is probably that the multiplication is done by the FPU, which then sets the FPU event that prevents the CPU from going to sleep. You should clear the FPU event immediately before you call&amp;nbsp;sd_app_evt_wait(), as suggested &lt;a href="https://devzone.nordicsemi.com/support-private/support/200592"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to optimize the power consumption of a simple Broadcaster ?</title><link>https://devzone.nordicsemi.com/thread/143580?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 13:15:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c49c4f89-60e0-4691-a13b-31ac6f42847f</guid><dc:creator>Sylvain</dc:creator><description>&lt;p&gt;I found the source of the problem ... If I comment that line :&lt;pre class="ui-code" data-mode="c_cpp"&gt;int int_temperature = (int)(temperature*10);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The system work correctly with a consumption of around 3 uA.&lt;br /&gt;This behaviour is very strange. Do you have an explication ?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;typedef struct
{
    uint8_t  sensor_1;
    uint8_t  humidity_type;
    uint8_t  humidity_data;
    uint8_t  sensor_2;
    uint8_t  temperature_type;       
    uint8_t  temperature_int_data;
    uint8_t  temperature_dec_data;
    uint8_t  sensor_3;
    uint8_t  ANALOG_OUT_1_type;       
    uint8_t  ANALOG_OUT_1_high_data;
    uint8_t  ANALOG_OUT_1_mid_data;
    uint8_t  ANALOG_OUT_1_midlow_data;
    uint8_t  ANALOG_OUT_1_low_data;
} cayenne_lpp;

cayenne_lpp CAYENNE_LPP_FRAME; 

void initialise_cayenne_lpp_frame(){

  CAYENNE_LPP_FRAME.sensor_1 = SENSOR_01;
  CAYENNE_LPP_FRAME.humidity_type = HUMIDITY_TYPE;
  CAYENNE_LPP_FRAME.humidity_data = 0X88;
  CAYENNE_LPP_FRAME.sensor_2 = SENSOR_02;
  CAYENNE_LPP_FRAME.temperature_type = TEMPERATURE_TYPE;
  CAYENNE_LPP_FRAME.temperature_int_data = 0;
  CAYENNE_LPP_FRAME.temperature_dec_data = 0;
  CAYENNE_LPP_FRAME.sensor_3 = SENSOR_03;
  CAYENNE_LPP_FRAME.ANALOG_OUT_1_type = ANALOG_OUTPUT_TYPE;
}

int main(void)
{    
  ble_stack_init();
  advertising_init();
  //advertising_start();
    
  initialise_cayenne_lpp_frame();
   
  int int_temperature = (int)(temperature*10); /* THIS VARIABLE DOESN&amp;#39;T ALLOW TO GO IN SYSTEM ON LOW CONSUMPTION. WHY ?*/

  CAYENNE_LPP_FRAME.temperature_int_data = (int8_t)((int_temperature&amp;gt;&amp;gt;8)&amp;amp;0xFF);
  CAYENNE_LPP_FRAME.temperature_dec_data = (int8_t)((int_temperature) &amp;amp; 0xFF);
   
while (1){
        power_manage();
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to optimize the power consumption of a simple Broadcaster ?</title><link>https://devzone.nordicsemi.com/thread/143572?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 12:48:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c1a407d-9282-4f84-b6c0-0aa8c27cf863</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;The &lt;code&gt;sd_app_evt_wait()&lt;/code&gt; function is quite simple, so I do not see how it can fail. However, the state of the device is of great importance. The current consumption could indicate that the CPU is active, so perhaps something causes immediate and repeated wake up after you have called &lt;code&gt;sd_app_evt_wait()&lt;/code&gt;. Can you upload your code here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to optimize the power consumption of a simple Broadcaster ?</title><link>https://devzone.nordicsemi.com/thread/143559?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 12:05:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5694c640-8e67-4bc0-a102-2d0f5158fdbf</guid><dc:creator>Sylvain</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;For now, &amp;nbsp;I use the PCA10056 and for the current measurement I put the board in nRF only mode. In debug mode, I see that all the ram are activated maybe it&amp;#39;s the problem.&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t activated any other peripheral ... I&amp;#39;m asking myself if the softdevice power management works in my code&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to optimize the power consumption of a simple Broadcaster ?</title><link>https://devzone.nordicsemi.com/thread/143552?ContentTypeID=1</link><pubDate>Thu, 09 Aug 2018 11:45:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ad24bcf-4fb1-42ca-a94b-9be52cff94ae</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You do not need to do anything other than calling&amp;nbsp;sd_app_evt_wait() in the main loop, which I assume you do. In that case, the SoftDevice will only keep the 32 kHz clock and RTC active, so you should see a current consumption of approximately 2&amp;nbsp;μA. However, the SoftDevice will not disable any clocks or peripherals the application has enabled, so if you use other peripherals or have UART logging enabled, you will see a much higher current consumption. Still 3 mA is a bit high, though. Do you have any other components on your PCB that could cause a high current consumption, such as a LED?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to optimize the power consumption of a simple Broadcaster ?</title><link>https://devzone.nordicsemi.com/thread/143423?ContentTypeID=1</link><pubDate>Wed, 08 Aug 2018 15:19:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a142799-3a61-48cf-81d7-07f0fb5cb465</guid><dc:creator>Sylvain</dc:creator><description>&lt;p&gt;edited on the first post.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to optimize the power consumption of a simple Broadcaster ?</title><link>https://devzone.nordicsemi.com/thread/143419?ContentTypeID=1</link><pubDate>Wed, 08 Aug 2018 15:13:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8b3b06b-bfb2-48b3-846c-4e683ef66ab4</guid><dc:creator>cbd</dc:creator><description>&lt;p&gt;Which processor and SDK are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>