AnsweredAssumed Answered

WatchDog Implementation on STM32F0 Discovery

Question asked by chinniwhites on Nov 12, 2012
Latest reply on Nov 13, 2012 by chinniwhites
The following is my watchdog code.  The watchdog is triggering and I am constantly find myself in the startup routine.  Why?  Here is my watchdog related code:

//After Periph Clock set and before GPIO and NVIC setup
//RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG, ENABLE);
    //WWDG_SetPrescaler(WWDG_Prescaler_1);
    //WWDG_SetWindowValue(0x7F);
    //WWDG_Enable(0x7F);

//in main's while loop

//1 tick = 10ms
        if (timeDiff >= 10){
            //WWDG_SetCounter(0x7F);
            for (loop = 0; loop < TIMERSIZE; loop++){
                if (tmrOn[loop] > 0){
                    on = 1;
                }
                else{
                    on = 0;
                }
                if (tmrTicks[loop] > 65530u){
                    tmrTicks[loop] = 65530u;
                }
                tmrTicks[loop] = on * (tmrTicks[loop] + 1);
            }
            lastTime = time;
            timeDiff = 0;
        }

Outcomes