This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Maximum Reload time for WDT

Hi Guys, 

We have a need to send data every 4 hours. 

In order to do this, we sleep 1 hour at a time (1-hour timer - single shot) and increment counter, and when the count is 4 we send the data. This is working well. 

Due to unknown reasons the device sometimes can get hung when trying to send the data. 

Our plan was to set the WDT_CONFIG_RELOAD_VALUE to 120000000, to make sure we reset the device after 1 hour if it got stuck. 

But we are unable to provide values more than 600000 (which triggers at 100 seconds). 

Can u suggest a way to configure such a large interval? 

regards

Shankar

Parents
  • I am not sure what is the problem here, but there is watchdog example in the SDK that should be possible to use as reference. 

    As a side comment, have you done any calculation on the current consumption?

    The system ON idle current with an RTC running is ~1.7uA depending on how much RAM you retain during sleep.

    If you wakeup every 100 seconds for ~50us then the average increase is ~0.002uA. In other words there is no difference in battery life whether you wakeup every 100 seconds or 1hour, because the idle current is about ~1000x larger.

    Best regards,
    Kenneth

Reply
  • I am not sure what is the problem here, but there is watchdog example in the SDK that should be possible to use as reference. 

    As a side comment, have you done any calculation on the current consumption?

    The system ON idle current with an RTC running is ~1.7uA depending on how much RAM you retain during sleep.

    If you wakeup every 100 seconds for ~50us then the average increase is ~0.002uA. In other words there is no difference in battery life whether you wakeup every 100 seconds or 1hour, because the idle current is about ~1000x larger.

    Best regards,
    Kenneth

Children
  • Hi Kenneth, 

    I did use the example as a reference. Please look at my comment on the previous reply. I did try using the example as a reference. 

    The reason why we are trying to do 1 hour, is to make sure the device indeed wakes up after 1 hour, in case the timer for 1 hour was not set right after sending data to server. I have seen some conflicts in running multiple timers at the same time. so this is just a catchall watchdog. 

    regards

    Shankar

  • Hi Keneth,

    I also want to put device to sleep for 1 hour, but with current even lower than ~1.7uA. Please let me know if this is feasible:

    - disable all peripherals except WDT
    - disable interrupts
    - reload WDT with 1 hour wakeup
    - Power off all RAM blocks
    - halt the CPU

    After one hour there will be reset, right. I can't do that with wakeup every 100sec. Is that correct?

    Best regards

    Kerim

  • You can find some current consumption values listed here:
    https://infocenter.nordicsemi.com/topic/ps_nrf52840/_tmp/graviton/autodita/CURRENT/parameters.i_sleep.html

    The current consumption with an RTC clock (LFCLK) running can get as low as ION_RAMOFF_RTC , typical 1.5uA. That equal about 13mAh a year.

    Best regards,
    Kenneth

  • Hi Kenneth,

    Yes, but 0.97uA in that link sounds better than 1.5uA Slight smile

    - System ON, no RAM retention, wake on any event  =>  0.97uA

    In my design, battery has to last 10 years, hence nanoamps count. And my device spends 90% of time sleeping.


    Thing is that with no RAM retention only reset wakeup will work, where WDT comes handy.
    You didn't answer my question, is it feasible what I propose?

    Regards

    Kerim

  • The WDT needs the LF clock to be running. LFRC consumes 0.3uA in ULP mode (LFXO is at 0.25uA, but requires much longer startup time)

    0.97uA (sys on, no RAM) + 0.3uA = 1.27 uA. (typical value)

    I did some measurements here and I actually got a bit lower; 972 nA in sleep:

    In my test the WDT is resetting every 10 seconds.

    The wakeup charge is 5.9uC:

    This gives an additional average current of 5.9uC / 3600 sec = 1.6 nA if the WDT is resetting the chip every 1 hour. Which is of course negligible, but with more advanced initialization code, this should maybe be taken into consideration. Here is my test code:

    int main(void)
    {
        NRF_CLOCK->LFCLKSRC = 0; // LFRC
        NRF_CLOCK->LFRCMODE = 1; // ULP mode
        NRF_CLOCK->TASKS_LFCLKSTART = 1; // Start LF clock
        while(!NRF_CLOCK->EVENTS_LFCLKSTARTED){
        }
        NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
        NRF_WDT->CRV = 327680; // WDT wakeup every 10 sec
        NRF_WDT->TASKS_START = 1; // start WDT
        for(int i = 0; i < 8; i++){
            NRF_POWER->RAM[i].POWERCLR = 0x3; // Turn off RAM block 0-7
        }
        NRF_POWER->RAM[8].POWERCLR = 0x3F; // Turn off RAM block 8
        
        for(;;){
            __WFE();
        }
    }

Related