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

51422 Watchdog timer - reset

What's the trick to using the WDT without causing a system reset??? We want to use the WDT for a pause mechanism - then continue from the pause at the same Main location? tks!

Parents
  • 'm not sure what you're trying to use the WDT for. WDT is typically used to effect a CPU reset in case your code freezes or deadlocks.

    Typical usage is:

    • set CONFIG to (WDT_CONFIG_SLEEP_Pause << WDT_CONFIG_SLEEP_Pos) (see nrf51_bitfields.h for more options)
    • set the CRV register to 32768 * number of seconds to wait before CPU reset
    • set RREN to WDT_RREN_RR0_Msk
    • set TASKS_START to 1
    • set RR[0] to WDT_RR_RR_Reload on every loop of your main loop (and also any long running subroutine) to prevent WDT from triggering
Reply
  • 'm not sure what you're trying to use the WDT for. WDT is typically used to effect a CPU reset in case your code freezes or deadlocks.

    Typical usage is:

    • set CONFIG to (WDT_CONFIG_SLEEP_Pause << WDT_CONFIG_SLEEP_Pos) (see nrf51_bitfields.h for more options)
    • set the CRV register to 32768 * number of seconds to wait before CPU reset
    • set RREN to WDT_RREN_RR0_Msk
    • set TASKS_START to 1
    • set RR[0] to WDT_RR_RR_Reload on every loop of your main loop (and also any long running subroutine) to prevent WDT from triggering
Children
Related