<?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>Voltage drop triggers BOR reset; MCU occasionally completely freezes</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/116224/voltage-drop-triggers-bor-reset-mcu-occasionally-completely-freezes</link><description>Hi, 
 I&amp;#39;m facing a critical issue with our sensor&amp;#39;s power setup and would really appreciate any insights or suggestions. 
 Our sensor is currently using a CR2477 battery, and I&amp;#39;m running into problems due to the load resistance of the battery. When transmitting</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 19 Nov 2024 16:26:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/116224/voltage-drop-triggers-bor-reset-mcu-occasionally-completely-freezes" /><item><title>RE: Voltage drop triggers BOR reset; MCU occasionally completely freezes</title><link>https://devzone.nordicsemi.com/thread/511155?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2024 16:26:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb2243f6-4f75-4ab6-ad21-1d457eb35365</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;I should clarify the required PPK2 connections, just in case not obvious. The coin call connects to PPK2 VIN and GND in Ampere Mode with no capacitors on the battery; the extra capacitors should be connected between VOUT and GND as the required measurement is just the battery current, not the battery current plus extra capacitor current. I wonder if in the measurements shown above the capacitors are instead on battery and VIN.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Voltage drop triggers BOR reset; MCU occasionally completely freezes</title><link>https://devzone.nordicsemi.com/thread/510959?ContentTypeID=1</link><pubDate>Mon, 18 Nov 2024 18:52:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80f823b7-337d-4a86-9310-88c302948f45</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;The curves are as expected; pity the PPK-2 doesn&amp;#39;t allow voltage measurement, and thence power calculations, which would illustrate why. Current is a don&amp;#39;t care here, voltage dip is all that matters as the voltage dip is what causes brownout issues. For a given power burst (typically BLE Tx transmit) higher available current (bigger caps) means lower voltage dip: volts x amps will be similar in both cases, except losses will be higher with the smaller capacitance as more current during the pulse is sourced via the battery resistive internals which is bad for the battery, bad for the planet and reduces anticipated product life.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Voltage drop triggers BOR reset; MCU occasionally completely freezes</title><link>https://devzone.nordicsemi.com/thread/510953?ContentTypeID=1</link><pubDate>Mon, 18 Nov 2024 18:19:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33e8627c-0619-4ac2-84bc-2d844051211f</guid><dc:creator>Phobios</dc:creator><description>&lt;p&gt;&amp;nbsp;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/hmolesworth"&gt;hmolesworth&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;sry I have to dig out the post again, but I&amp;#39;ve now prepared some Sensors with additional 100&amp;micro;F/6V3 and 47&amp;micro;F/10V ceramic capacitors. I&amp;#39;ve made some comparison measurements with NRF Power Profiler 2. I&amp;#39;m a little puzzled, cause with the additional capacitors, the current spikes are higher, than without.&lt;/p&gt;
&lt;p&gt;Measurement 1: Sensor with 47&amp;micro;F&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/curretn1x47.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Measurement 2: Sensor with 2x47&amp;micro;F and 100&amp;micro;F&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/curretn2x47_2B00_100.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The really odd thing is: If I meassure the voltage drop, the more capacitors helps (and I&amp;#39;ve not swaped any measurements, I checked it three times)&lt;/p&gt;
&lt;p&gt;Any suggestions?&lt;/p&gt;
&lt;p&gt;Thanks and Best Regards,&lt;/p&gt;
&lt;p&gt;Phobios&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Voltage drop triggers BOR reset; MCU occasionally completely freezes</title><link>https://devzone.nordicsemi.com/thread/510374?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2024 20:58:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5511b07-559d-4fea-b032-e850cff4e89f</guid><dc:creator>Phobios</dc:creator><description>&lt;p&gt;Thanks a lot hmolesworth and Einar with your code examples. Both works fine and helped me a lot.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Voltage drop triggers BOR reset; MCU occasionally completely freezes</title><link>https://devzone.nordicsemi.com/thread/510305?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2024 13:30:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ab27623-0090-4d00-b564-8d8bfe70a6b4</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see. There are no official samples of using the&amp;nbsp;power-fail-comparator in the nRF Connect SDK,&amp;nbsp;this is a small code snippet that demonstrate how it can be used (with&amp;nbsp;&lt;code&gt;CONFIG_NRFX_POWER=y&lt;/code&gt; added to prj.conf or similar):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#if CONFIG_NRFX_POWER
#include &amp;lt;nrfx_power.h&amp;gt;

void pof_cb(void)
{
	printk(&amp;quot;POF event\n&amp;quot;);
}

static void pof_enable(void)
{
	nrfx_power_pofwarn_config_t pof_config = {
		.handler = pof_cb, 
		.thr = NRF_POWER_POFTHR_V22,
		.thrvddh = NRF_POWER_POFTHRVDDH_V29
	};

	nrfx_power_pof_init(&amp;amp;pof_config);
	nrfx_power_pof_enable(&amp;amp;pof_config);
}
#endif &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/samples/bluetooth/hci_pwr_ctrl/README.html"&gt;HCI Power Control&lt;/a&gt;&amp;nbsp;sample demonstrate settign the Tx power runtime. You could do it adaptively based on RSSI (and/or battery condition), but that would be up to you.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Voltage drop triggers BOR reset; MCU occasionally completely freezes</title><link>https://devzone.nordicsemi.com/thread/510203?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2024 23:43:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac6ea694-76cd-4429-b1eb-e0b4443e4253</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Here&amp;#39;s some code which will characterise a Lithium coin cell; the same code can be used to disallow radio transmissions when the battery is determined to be exhausted. The code turns on a high-current load (CPU plus Radio Tx or CPU plus Radio Rx) for 10 seconds every 2 minutes, and measures the difference in battery voltage between the start and end of transmission. In a real application this code would be run after a reset and periodically by disabling any higher-level firmware such as a SoftDevice. Note here I&amp;#39;ve enabled the HFCLK to get accurate UART timing, but that could be turned off in sleep.&lt;/p&gt;
&lt;p&gt;Sample output on a CR2032; the first reading is low since a rest time was not used prior to the load (note using nRF52840 CPU sleep Radio Tx Only 11mA):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Starting Battery Pulse load test, Tx Pulse: 10 Secs, Rest: 110 Secs
Coin Cell at     10 secs: After Rest: 2822mV, After Tx Pulse: 2600mV, Droop:  222mV
Coin Cell at    130 secs: After Rest: 2876mV, After Tx Pulse: 2608mV, Droop:  268mV
Coin Cell at    250 secs: After Rest: 2882mV, After Tx Pulse: 2605mV, Droop:  277mV
...
Coin Cell at  15354 secs: After Rest: 2809mV, After Tx Pulse: 2505mV, Droop:  304mV
Coin Cell at  15474 secs: After Rest: 2817mV, After Tx Pulse: 2505mV, Droop:  312mV
...
Coin Cell at  54313 secs: After Rest: 2745mV, After Tx Pulse: 2403mV, Droop:  342mV
Coin Cell at  54433 secs: After Rest: 2742mV, After Tx Pulse: 2401mV, Droop:  341mV
...
Coin Cell at 100106 secs: After Rest: 2746mV, After Tx Pulse: 2418mV, Droop:  328mV
Coin Cell at 100226 secs: After Rest: 2748mV, After Tx Pulse: 2416mV, Droop:  332mV
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Main code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void TestRadioAsBatteryLoad(void)
{
   // 11.35mA NRF_RADIO-&amp;gt;TXPOWER = 0x08
   // 23.17mA NRF_RADIO-&amp;gt;TXPOWER = 0x04
   // 17.42mA NRF_RADIO-&amp;gt;TXPOWER = 0x00, nRF52840 CPU sleep Radio Tx Only 11mA

   char CoinInfoPacket[240] = &amp;quot;?&amp;quot;;
   uint16_t BatteryVoltsA = 0, BatteryVoltsB = 0;
   mClocksInit();
   mRtcInit();
   snprintf(CoinInfoPacket, sizeof(CoinInfoPacket)-1, &amp;quot;Starting Battery Pulse load test, Tx Pulse: %hu Secs, Rest: %hu Secs\r\n&amp;quot;, BATTERY_LOAD_TIME_MSECS, BATTERY_REST_TIME_MSECS);
   uartSend(CoinInfoPacket, strlen(CoinInfoPacket));
   while (true)
   {
      // Check for load on time
      if (mStartLoadTest)
      {
         BatteryVoltsA = GetBatteryVoltageLocal();
         // Start HFCLK crystal oscillator for radio
         NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;
         __DSB();
         while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0) ;
         NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED = 0;
         NRF_RADIO-&amp;gt;MODE = 0; // 1 Mbps Nordic proprietary radio mode
      // NRF_RADIO-&amp;gt;TXPOWER = 0x08; // +8dBm 11.35mA
      // NRF_RADIO-&amp;gt;TXPOWER = 0x04; // +4dBm 23.17mA
         NRF_RADIO-&amp;gt;TXPOWER = 0x00; //  0dBm 17.42mA, nRF52840 CPU sleep Radio Tx Only 11mA
         NRF_RADIO-&amp;gt;TASKS_TXEN = 1;
         mStartLoadTest = false;
      }
      // Check for load turn-off time
      if (mStopLoadTest)
      {
         BatteryVoltsB = GetBatteryVoltageLocal();
         NRF_RADIO-&amp;gt;TASKS_STOP = 1;
         __DSB();
         NRF_RADIO-&amp;gt;TASKS_DISABLE = 1;
         __DSB();
         while (NRF_RADIO-&amp;gt;EVENTS_DISABLED == 0) ;
         NRF_RADIO-&amp;gt;POWER = 0; // Set RADIO back to defaults
         __DSB();
         NRF_RADIO-&amp;gt;POWER = 1;
         // Drops to 1uA after Radio power test with Radio powered down
         // Starting Battery Pulse load test, Tx Pulse: 10 Secs, Rest: 110 Secs
         // Coin Cell at     10 secs: After Rest: 2817mV, After Tx Pulse: 2612mV, Droop:  205mV
         // Coin Cell at    130 secs: After Rest: 2881mV, After Tx Pulse: 2619mV, Droop:  262mV
         // Coin Cell at    250 secs: After Rest: 2884mV, After Tx Pulse: 2614mV, Droop:  270mV
         // Coin Cell at    370 secs: After Rest: 2877mV, After Tx Pulse: 2619mV, Droop:  258mV
         snprintf(CoinInfoPacket, sizeof(CoinInfoPacket)-1, &amp;quot;Coin Cell at %6u secs: After Rest: %4humV, After Tx Pulse: %4humV, Droop: %4humV\r\n&amp;quot;, mBatteryTestTimer/RTC_TICKS_PER_SECOND, BatteryVoltsA, BatteryVoltsB, BatteryVoltsA-BatteryVoltsB);
         uartSend(CoinInfoPacket, strlen(CoinInfoPacket));
         mStopLoadTest = false;
         // Stop HFCLK crystal oscillator to reduce sleep current
         NRF_CLOCK-&amp;gt;TASKS_HFCLKSTOP = 1;
         __DSB();
      }
      // Wakeup RTC_TICKS_PER_SECOND (8) times per second
      while(!mRTC_Tick)
      {
         // Errata 220: CPU: RAM is not ready when written - Disable IRQ while using WFE
         // Enable SEVONPEND to disable interrupts so the internal events that generate the interrupt cause wakeup 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
         //
         // 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();
         // Clear the internal event register and wait for event - note an interrupt is required
         __WFE(); __SEV(); __WFE(); __NOP(); __NOP(); __NOP(); __NOP();
         __enable_irq();
      }
      // Get here RTC_TICKS_PER_SECOND (8) times per second
      mRTC_Tick = false;
   }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Supporting functions:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define BATTERY_LOAD_TIME_MSECS  10     // mSecs: Hard load on battery, CPU plus with Radio Tx on
#define BATTERY_REST_TIME_MSECS 110     // mSecs: Rest time for battery, CPU sleep with Radio Tx off
#define RTC_TICKS_PER_SECOND      8UL   // RTC ticks per second using 8 Hz

static NRF_RTC_Type *pBatteryLoadRTC  = NRF_RTC2;
IRQn_Type BatteryLoadRTC_IRQn         = RTC2_IRQn;
volatile bool mRTC_Tick               = true;
volatile bool mLoadTestIsActive       = true;
volatile bool mStartLoadTest          = true;
volatile bool mStopLoadTest           = false;
volatile uint32_t mBatteryTestTimer   = (RTC_TICKS_PER_SECOND/2);  // Elasped test time, add rounding for seconds
volatile uint32_t mBatteryLoadTimer   = 0UL;
volatile uint32_t mBatteryRestTimer   = 0UL;

void RTC2_IRQHandler(void)
{
    if (pBatteryLoadRTC-&amp;gt;EVENTS_TICK == 1)
    {
        pBatteryLoadRTC-&amp;gt;EVENTS_TICK = 0;
        mRTC_Tick = true;
        // Update elapsed test timer, 8 ticks/second
        mBatteryTestTimer++;
        // Check for end-of-test
        if (mLoadTestIsActive &amp;amp;&amp;amp; (++mBatteryLoadTimer &amp;gt;= BATTERY_LOAD_TIME_MSECS*RTC_TICKS_PER_SECOND))
        {
           mLoadTestIsActive = false;
           mStopLoadTest = true;
           mBatteryRestTimer = 0UL;
        }
        // Check for start-of-test
        if (!mLoadTestIsActive &amp;amp;&amp;amp; (++mBatteryRestTimer &amp;gt;= BATTERY_REST_TIME_MSECS*RTC_TICKS_PER_SECOND))
        {
           mLoadTestIsActive = true;
           mStartLoadTest = true;
           mBatteryLoadTimer = 0UL;
        }
    }
    // Clear any pending hardware register bus operations
    __DSB();
}

static void mRtcInit(void)
{
   // Start RTC, enable TICK event
   // Select tick: 12 bit prescaler for COUNTER frequency (32768/(PRESCALER+1)). Must be written when RTC is stopped
   pBatteryLoadRTC-&amp;gt;PRESCALER = 4095; // max prescaler 0xFFF -&amp;gt; 8 Hz &amp;quot;Tick&amp;quot;
   pBatteryLoadRTC-&amp;gt;EVTENSET = RTC_EVTENSET_TICK_Msk;
   // Set interrupt priority and enable interrupt
   NVIC_SetPriority(BatteryLoadRTC_IRQn, 6);
   NVIC_ClearPendingIRQ(BatteryLoadRTC_IRQn);
   NVIC_EnableIRQ(BatteryLoadRTC_IRQn);
   // Enable tick interrupt
   pBatteryLoadRTC-&amp;gt;INTENSET = 0x00001;
   // The update of COUNTER relies on a stable LFCLK, TASKS_START while LFCLK is not running will start
   // LFCLK, but the update will be delayed by up to ~250 us
   pBatteryLoadRTC-&amp;gt;TASKS_START = 1;
}

// Input range = (0.6 V)/(1/6) = 3.6 V
#define ADC12_COUNTS_PER_VOLT 1138  // 12-bit Mode
uint16_t GetBatteryVoltageLocal(void)
{
   uint16_t result = 9999;
   uint32_t timeout = 10000;
   volatile int16_t buffer[8];
   uint32_t i=0;  // SAADC Channel
   // Configure SAADC singled-ended channel, Internal reference (0.6V) and 1/6 gain
   NRF_SAADC-&amp;gt;CH[i].CONFIG = (SAADC_CH_CONFIG_GAIN_Gain1_6    &amp;lt;&amp;lt; SAADC_CH_CONFIG_GAIN_Pos)   |
                             (SAADC_CH_CONFIG_MODE_SE         &amp;lt;&amp;lt; SAADC_CH_CONFIG_MODE_Pos)   |
                             (SAADC_CH_CONFIG_REFSEL_Internal &amp;lt;&amp;lt; SAADC_CH_CONFIG_REFSEL_Pos) |
                             (SAADC_CH_CONFIG_RESN_Pullup     &amp;lt;&amp;lt; SAADC_CH_CONFIG_RESN_Pos)   |
                             (SAADC_CH_CONFIG_RESP_Pullup     &amp;lt;&amp;lt; SAADC_CH_CONFIG_RESP_Pos)   |
                             (SAADC_CH_CONFIG_TACQ_40us       &amp;lt;&amp;lt; SAADC_CH_CONFIG_TACQ_Pos);
   NRF_SAADC-&amp;gt;RESOLUTION = SAADC_RESOLUTION_VAL_12bit &amp;lt;&amp;lt; SAADC_RESOLUTION_VAL_Pos;
   // Analog positive and negative input channels have strange numbering:
   //  PSELP_NC           0UL  Not connected
   //  PSELP_AnalogInput0 1UL  AIN0
   //  PSELP_AnalogInput1 2UL  AIN1
   //  PSELP_AnalogInput2 3UL  AIN2
   //  PSELP_AnalogInput3 4UL  AIN3
   //  PSELP_AnalogInput4 5UL  AIN4
   //  PSELP_AnalogInput5 6UL  AIN5
   //  PSELP_AnalogInput6 7UL  AIN6
   //  PSELP_AnalogInput7 8UL  AIN7
   //  PSELP_VDD          9UL  VDD
   NRF_SAADC-&amp;gt;CH[i].PSELP = SAADC_CH_PSELN_PSELN_VDD &amp;lt;&amp;lt; SAADC_CH_PSELN_PSELN_Pos;
   NRF_SAADC-&amp;gt;CH[i].PSELN = SAADC_CH_PSELN_PSELN_NC &amp;lt;&amp;lt; SAADC_CH_PSELN_PSELN_Pos;
   // Enable SAADC
   NRF_SAADC-&amp;gt;ENABLE = 1;
   // Enable command
   nrf_saadc_enable();
   NRF_SAADC-&amp;gt;RESULT.PTR = (uint32_t)buffer;
   NRF_SAADC-&amp;gt;RESULT.MAXCNT = 1;
   nrf_saadc_event_clear(NRF_SAADC_EVENT_END);
   nrf_saadc_task_trigger(NRF_SAADC_TASK_START);
   nrf_saadc_task_trigger(NRF_SAADC_TASK_SAMPLE);
   while (0 == nrf_saadc_event_check(NRF_SAADC_EVENT_END) &amp;amp;&amp;amp; timeout &amp;gt; 0)
   {
      timeout--;
   }
   nrf_saadc_task_trigger(NRF_SAADC_TASK_STOP);
   nrf_saadc_event_clear(NRF_SAADC_EVENT_STARTED);
   nrf_saadc_event_clear(NRF_SAADC_EVENT_END);
   // Disable command
   nrf_saadc_disable();
   if (timeout != 0)
   {
      // Calculate mVolt value, assume 16-bit unsigned for prints
      result = (uint16_t)((((int32_t)buffer[0] * 1000L)+(ADC12_COUNTS_PER_VOLT/2)) / ADC12_COUNTS_PER_VOLT);
   }
   return result;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;See also&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/jzone"&gt;jzone&lt;/a&gt;&amp;nbsp;post &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/114986/creating-a-load-on-a-battery-using-the-radio"&gt;creating-a-load-on-a-battery-using-the-radio&lt;/a&gt;&amp;nbsp;and other older posts where I propose load tests&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Voltage drop triggers BOR reset; MCU occasionally completely freezes</title><link>https://devzone.nordicsemi.com/thread/510007?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2024 02:18:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c130c661-99c0-41ed-a9fa-c60455c13623</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Open-circuit voltage measurement on a coin cell is almost meaningless; a coin cell discharged by over 90% of capacity can measure 2.95 volts after suitable rest period, so looking like almost full capacity but actually nearly fully discharged. I have seen this on batteries over 6 years old. I&amp;#39;ll post some measurement code when I get a moment, hopefully tomorrow.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Voltage drop triggers BOR reset; MCU occasionally completely freezes</title><link>https://devzone.nordicsemi.com/thread/509941?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2024 15:10:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2795cd23-81d2-4a7c-a2b9-e27505ba62b3</guid><dc:creator>Phobios</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m certain it is a BOR; the RESETREAS is cleared and also the RTT logging doesn&amp;#39;t show any information about another reset. The plot was only a measurement of different capacitors with a known load; it was not the critical battery which created the BOR.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m thinking of setting up the power-fail-comparator, and if the voltage gets critical (say about 2V) I&amp;#39;ll only sending sporadically the urgent messages. Is there an example of using the POR in Zephyr?&lt;/p&gt;
&lt;p&gt;Additionally to the POR I&amp;#39;m&amp;nbsp;decreasing the TX power. Currently I&amp;#39;m using +8dBm. Is there an automatic adaptive way to alter the TX power depending on the RSSI e.g. with good RSSI values I can decrease the TX power one step? Or do I have to program this in my user firmware?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Voltage drop triggers BOR reset; MCU occasionally completely freezes</title><link>https://devzone.nordicsemi.com/thread/509940?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2024 15:09:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35b0cc1f-ea45-4ea5-9a21-bcac1ff3b6f9</guid><dc:creator>Phobios</dc:creator><description>&lt;p&gt;Thanks again, you rly are an&amp;nbsp;expert on this topic :)&lt;/p&gt;
&lt;p&gt;The way you measure the remaining capacitance of batteries is a new approach for me, but a very promising one. Up to this moment I was only measuring voltage at no load; I know it is not exact but I though the last week before the battery dies it will slowly drop from 3V to 0 and I can alert the user in advance.&lt;/p&gt;
&lt;p&gt;If I measure the voltage drop and its decay rate in time; which drop and rate will be which capacitance. How can I say the battery is at 100%, 75%, 60%, 50%, ... and so on? Do I have to pre-measure each manufacturer battery and create a comparison sheet, or is there an overall rule?&lt;/p&gt;
&lt;p&gt;Also do you have an example code on how to measure the decay rate with an ADC?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Voltage drop triggers BOR reset; MCU occasionally completely freezes</title><link>https://devzone.nordicsemi.com/thread/509921?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2024 14:25:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd173d86-9d26-4012-9e3b-3899c34a9dee</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If I read the plot you had correctly, the voltage only drops down to 2.735, so I do not see how this could be a brown out reset. Did you read the &lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf52840/page/power.html#register.RESETREAS"&gt;RESETREAS&lt;/a&gt;&amp;nbsp;register and confirm that it was a BOR or power-on reset (in both cases the register will be cleared), or do you just see a reset and assumed a BOR?&lt;/p&gt;
&lt;p&gt;If you just see a reset, the first thing I would suspect was some form of firmware error, where the error handler triggers a soft reset, which is the default behaviour (and particularily usefull in release builds in order to recover from unhandled errors). I suggest starting with basic debugging to see what is happening. If you have loggign enabled, you can check the log. You can also add&amp;nbsp;&lt;code&gt;CONFIG_RESET_ON_FATAL_ERROR=n&lt;/code&gt; in your prj.conf to not get a reset when an error has occured).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Voltage drop triggers BOR reset; MCU occasionally completely freezes</title><link>https://devzone.nordicsemi.com/thread/509772?ContentTypeID=1</link><pubDate>Sat, 09 Nov 2024 23:26:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:638c0250-d5e8-47dc-9090-f869613f97d2</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Ceramic capacitors when used as bulk capacitance require a voltage rating 2 x the actual coin cell voltage, so a rating of at least 6 volts in this case (discussed elsewhere); lower ceramic capacitor voltage ratings reduce the effective storage capacitance. BLE transmission is fine with VDD pulsed low to as low as 1.7 volts, however the Brownout Reset activates at 1.7 volts so best to set a Power Fail warning (then force Radio etc off and immediate low-power mode) at (say) 2.0 volts until the coin cell has sufficient rest to recover.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1731193413049v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;The Brownout detector is a DC level; the PowerOn reset is not which means slow VDD rise times from a low voltage near 0 may not reset properly which leaves the nRF52840 unresponsive. Avoid a Brownout reset or in-use partial poweron reset at all costs; be severe with Powerfail detection and force low power. On power-up or recovery from low power detection measure the coin cell status by applying a known load for a brief period and monitor the decay in Vbatt to ensure the coin cell has sufficiently recovered before allowing normal operation.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1731193560089v2.jpeg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Coin cell capacity is notoriously variable; avoid low-cost equivalents, if possible use &amp;quot;Medical&amp;quot; versions. Ideally verify operation with a few manufacturers and specify pulsed operation when asked for application data.&lt;/p&gt;
&lt;p&gt;The nRF52840 should of course have DC-DC enabled and although the nRF52840 works fine down to (say) 1.8 volts note that other attached circuits don&amp;#39;t; for example LEDs will flicker on BLE transmission unless driven by a separate boost regulator or simple voltage-doubler and monitor circuit. Most external peripheral analogue circuits work fine to 1.8V but some don&amp;#39;t, and in any case voltage dips alias into analogue readings. BLE packets transmitted 8 times a second will alias into a 8Hz waveform on that nice otherwise clean brain wave. Fix by separating the voltage sources of Radio and external analogue, typically with Maxim Ideal Diode with separate bulk capacitance for each. Analogue VDD can be taken from the OUT pin with local bulk capacitance. nRF52840 and coin cell with bulk capacitance are on MAX40203 VDD pin.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1731194476969v3.png" /&gt;&lt;/p&gt;
&lt;p&gt;The Ideal Diode allows the local bulk capacitance to hold up the external analogue supply when the nRF52840 VDD dips down to a much lower voltage.&lt;/p&gt;
&lt;p&gt;I posted some more here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/69879/weird-issue-observed-with-nrf52832/286576"&gt;weird-issue-observed-with-nrf52832&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/109788/functionality-if-vdd-does-not-go-to-0v-when-powered-down/476363"&gt;functionality-if-vdd-does-not-go-to-0v-when-powered-down&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Voltage drop triggers BOR reset; MCU occasionally completely freezes</title><link>https://devzone.nordicsemi.com/thread/509771?ContentTypeID=1</link><pubDate>Sat, 09 Nov 2024 21:24:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce43a87c-906f-416c-9c16-2f855115eca0</guid><dc:creator>Phobios</dc:creator><description>&lt;p&gt;Hi hmolesworth,&lt;/p&gt;
&lt;p&gt;thank you very much for your detailed answer. I&amp;#39;ve&amp;nbsp;made a test with some ceramic capacitors. This image shows two measurements where I enable a load of about 7mA (440Ohm @3V) for about 5ms. The RED voltage is without any capacitor, the BLUE with 2x47&amp;micro;F.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I see an improvement, but I&amp;#39;m a little worried, that the voltage drop is still that high, I hoped for a way better buffering. Are the values reasonable? Show I add way more capacitors; I&amp;#39;m worried that over time the coin cell load resistance will get higher and then also the voltage drop - and I really want to use all the 1000mAh from the CR2477&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1731186182138v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve also measured CR2477 from different companies and got better results with some. Have you some experience which manufacturer has good coin cell batteries?&lt;/p&gt;
&lt;p&gt;Thank you very much,&lt;br /&gt;Phobios&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Voltage drop triggers BOR reset; MCU occasionally completely freezes</title><link>https://devzone.nordicsemi.com/thread/509749?ContentTypeID=1</link><pubDate>Sat, 09 Nov 2024 03:24:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfb58cd2-0b17-4d11-bbdc-dad8d2dda86a</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Coin cells typically cause the issues noted; trick is to first treat the coin cell as a trickle charger to bulk capacitance (ie not the primary power source) and second to measure the remaining capacity prior to a current burst such as BLE data transmission. Lithium requires rest prior to use after a burst; capacity measurement can provide an indication of the remaining capacity at a given time. BLE transmissions use the bulk capacitance as a power source, not the coin cell. 47uF is insufficient; try 150uF (3 x 47uF) and use a low BOR&amp;nbsp; value. Coin cells after a pulse discharge recover voltage slowly, and this violates the VDD risetime for correct reset operation as the reset is not a simple DC threshold but an AC-coupled threshold so slow rise times leads to indeterminate states ie hangup.&lt;/p&gt;
&lt;p&gt;See my comments on these postings:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/38904/power-cycling-safeguard/150556"&gt;power-cycling-safeguard&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/114986/creating-a-load-on-a-battery-using-the-radio"&gt;creating-a-load-on-a-battery&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/102193/nrf52810-using-cr2032-in-freezing-temps/439565"&gt;using-cr2032-in-freezing-temps&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/103156/urgent-nrf52840-hanging-up-after-working-for-some-time/444406"&gt;nrf52840-hanging-up&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/103072/issues-with-power-on-reset-in-nrf52840---the-chip-hangs/442638"&gt;issues-with-power-on-reset-in-nrf52840&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>