cancel
Showing results for 
Search instead for 
Did you mean: 

Watchdog over ~22 seconds on STM303RE

Marius CO
Associate III

Hi,

Looks like I cannot get the wd over a ~22 seconds watch time .

I would like the watchdog to bark every 60 seconds or more.

The 303 header file specify the reload max 0xFFF and as well the window,

though they are 32bit values .

Also the max prescaler is IWDG_PRESCALER_256.

How do I get over 24 seconds barrier. I tought that this would work.

extern SystemCoreClock // is 80Mhz

Prescaller = 256.

Seconds = 60;

then

    uint32_t reload = seconds * (SystemCoreClock / 256);

    hiwdg.Instance      = IWDG;

    hiwdg.Init.Window   = reload-1;

    hiwdg.Init.Prescaler = IWDG_PRESCALER_256;

    hiwdg.Init.Reload   = reload;

1 REPLY 1

Watchdog count is only 12-bit, the variable is likely 32-bit to keep the ARM alignment straight.

Thought the IWDG clocking from the 40 KHz, not the SystemClock, so maximal about 26 seconds

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..