reset program using watchdog timer

i need to reset my program by using watchdog timer for every 8s. can anyone suggest me a code for that.

http://forum.arduino.cc/index.php?topic=63651.0

Well the arduino uno has a WDT compatible bootloader (some bootloaders don't handle WDT interrupts so can get hung up if the timeout value is too short) so the main pertinent steps will be

  1. Reset the WDT so it can't generate further interrupts
  2. Wait to see if the IDE is requesting to upload a new sketch, and if not then
  3. Jump to the sketch code which should
  4. Initialize timer 0 properly so the millis() function will work.
  5. Start the setup function of the user sketch.

There are other little details of course as the bootloader user digital pin 13 to blink the led and has to set it up as an output and then later set it back to a input, etc.

reset my program

Please explain what you mean by this.

LarryD:

reset my program

Please explain what you mean by this.

sometimes when code is running long time it's stuck. that's why i need to reset program in every few seconds.