<?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>NRF52840 SAADC High Current with FreeRTOS SDK15.2</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56657/nrf52840-saadc-high-current-with-freertos-sdk15-2</link><description>Hello, 
 I am need to add voltage sampling functionality to existing FreeRTOS framework on a low-power BLE device. When I enable BLE, I get 3mA of current, which stays there permanently . I have read all sorts of posts and guides for low power SAADC with</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 Jan 2020 20:46:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56657/nrf52840-saadc-high-current-with-freertos-sdk15-2" /><item><title>RE: NRF52840 SAADC High Current with FreeRTOS SDK15.2</title><link>https://devzone.nordicsemi.com/thread/230444?ContentTypeID=1</link><pubDate>Wed, 22 Jan 2020 20:46:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e24ba6fd-7924-49ef-826a-29649ac1c510</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;good to hear that we were on the right track and you fixed the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC High Current with FreeRTOS SDK15.2</title><link>https://devzone.nordicsemi.com/thread/230204?ContentTypeID=1</link><pubDate>Wed, 22 Jan 2020 02:31:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45d0e51c-1aef-44b3-a907-cfc4ec6faf54</guid><dc:creator>Jimmy Wong</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can refer to the description what I did.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://jimmywongiot.com/2019/07/31/current-consumption-with-freertos-on-nordic-nrf5-sdk/"&gt;https://jimmywongiot.com/2019/07/31/current-consumption-with-freertos-on-nordic-nrf5-sdk/&lt;br /&gt;&lt;/a&gt;&lt;a href="https://jimmywongiot.com/2019/07/29/how-to-add-the-battery-service-in-current-optimization"&gt;https://jimmywongiot.com/2019/07/29/how-to-add-the-battery-service-in-current-optimization&lt;/a&gt;&lt;a href="https://jimmywongiot.com/2019/07/31/current-consumption-with-freertos-on-nordic-nrf5-sdk/"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC High Current with FreeRTOS SDK15.2</title><link>https://devzone.nordicsemi.com/thread/230192?ContentTypeID=1</link><pubDate>Wed, 22 Jan 2020 00:42:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8708c76-7490-43bf-8af5-7cb418caff83</guid><dc:creator>kdubovenko</dc:creator><description>&lt;p&gt;Checked the exact FPU flags and am getting the&amp;nbsp;IXC - Inexact cumulative exception bit. This seems to imply that the result is &amp;quot;inexact&amp;quot; and needs to be rounded. The rounding is what throws the exception. I guessing this is because at some point of the calculation I get a repeating decimal.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC High Current with FreeRTOS SDK15.2</title><link>https://devzone.nordicsemi.com/thread/230189?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2020 23:48:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e4a551f-c817-4b0b-9681-a0d969a0cd89</guid><dc:creator>kdubovenko</dc:creator><description>&lt;p&gt;Hi Susheel, your advice to check NVIC-&amp;gt;ISPR was spot on. I saw that the FPU interrupt was active, this is becasue the data collected from ADC was converted to voltage using floating point math, I didn&amp;#39;t connect the issue with that until I check the NVIC register. I used the solution from &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/12433/fpu-divide-by-0-and-high-current-consumption"&gt;this&lt;/a&gt; thread to fix it. Specifically, I enabled the FPU interrupt handler. I added the following to my initialization code:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;//Configure FPU interrupts
NVIC_SetPriority(FPU_IRQn, APP_IRQ_PRIORITY_LOW);
NVIC_EnableIRQ(FPU_IRQn);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I also added the interrupt that clears FPU exceptions (apparently I&amp;#39;m throwing an exception although when I redo the calculations they are sound ... need to investigate further):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define FPU_EXCEPTION_MASK 0x0000009F

void FPU_IRQHandler(void)
{
    uint32_t *fpscr = (uint32_t *)(FPU-&amp;gt;FPCAR+0x40);
    (void)__get_FPSCR();

    *fpscr = *fpscr &amp;amp; ~(FPU_EXCEPTION_MASK);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;With this code, I&amp;#39;m getting proper functionality and the current draw is low, as expected. Thanks again!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC High Current with FreeRTOS SDK15.2</title><link>https://devzone.nordicsemi.com/thread/229707?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2020 20:08:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e599c8a2-3650-42a8-8d98-a314bb6181c9</guid><dc:creator>Patrick</dc:creator><description>&lt;p&gt;I have noticed in a few instances that the SAADC uses a large amount of current if I never calibrate it. I haven&amp;#39;t seen anyone else with this issue but might be worth a look.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 SAADC High Current with FreeRTOS SDK15.2</title><link>https://devzone.nordicsemi.com/thread/229632?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2020 13:43:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:690a9c51-ae9d-4357-8ab8-491ee49dae86</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Just to understand if this is related to FreeRTOS and/or BLE solely, what happens if you disable BLE and keep the SAADC functionality exercised ? does the power consumption stays high?&lt;/p&gt;
&lt;p&gt;If the answer to the above is yes, then most likely it is something that keeps the chip awake even though your app is (assuming) sleeping&amp;nbsp; in tickless idle sleep. Possibly some interrupt is being pended and not serviced, you can check that in you read NVIC-&amp;gt;ISPR register.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>