WATCHDOG TIMER Question?

14 Feb 2011

What does the code;

" Simulate a fault with an infinite loop, but only after 25 loop iterations if (count == 25) while (1) {}; LED 2 will stay on during the fault myled2 = 0; count ++; "

do in the WATCHDOG Timer code. Specifically how do I read "if (count == 25) while (1) {};"; does this send the program back to the beginning of the while() loop or is it another while() loop???

Where is it placed in the overall program code; at the end following the program code in the main program loop; or at the beginning of the main program loop???

14 Feb 2011

while (1) {}; is an infinite loop (the loop condition is always true), so it basically locks up the program. Since the program is stuck in the loop and does not kick the watchdog, eventually watchdog resets the device (and the program starts from the beginning).

14 Feb 2011

Thanks: That helps. I posted a question in the "mbed" forum called TICKER and WATCH DOG TIMER. Any chance you could take a look at that and see whats going on???

Thanks again Bill