2010-06-30 06:38 AM
Independent Watchdog never resets the processor
2011-05-17 04:56 AM
This is what I use and it is working:
static void start_watchdog(void) { RCC_LSICmd( ENABLE ); // enable low speed internal clock used by watchdog while (IWDG->SR & 0x3); // wait for previos update operations to complete IWDG->KR = 0x5555; // Enable independent watchdog register access IWDG->PR = 6; // prescaller set to divice by 256 (min 6.4ms, max 26214.4ms) IWDG->RLR = 0xFFF; // reload value (0xFFF max) IWDG->KR = 0xCCCC; // start the watchdog } void stroke_watchdog(void) { IWDG->KR = 0xAAAA; } Regards Trevor2011-05-17 04:56 AM
/* IWDG timeout equal to xxx ms (the timeout may varies due to LSI frequency dispersion) */
IWDG_WriteAccessCmd(IWDG_WriteAccess_Enable); /* Enable write access to IWDG_PR and IWDG_RLR registers */ /* IWDG counter clock: 40KHz(LSI) / 32 = 1.25 KHz, 256 = 156 Hz (Prescaler 4..256)*/ IWDG_SetPrescaler(IWDG_Prescaler_256); /* Set counter reload value to */ IWDG_SetReload(4056); // 12-bit downcount (0-4095), 26 seconds IWDG_ReloadCounter(); /* Reload IWDG counter */ IWDG_Enable(); /* Enable IWDG (the LSI oscillator will be enabled by hardware) */