How can I set up a watchdog interrupt vector timer on the Arduino Redboard/Uno? I'm trying to set up a watchdog timer interrupt to execute a routine in the WDT_vec ISR at some recurring interval. I don't want the processor to reset, just to execute the code in the interrupt and return to "normal" operation. I have the following test jig appropriated from the 'net that claims to set that up:

#include &lt;avr/wdt.h&gt;

 void setup_WDT() {
      noInterrupts();  // disable all the interrupts
      MCUSR = 0;       // ensure that the reset vectors are off

      /* Disable and clear all Watchdog settings. */

      _WD_CONTROL_REG = (1 &lt;&lt; WDCE) | (1 &lt;&lt; WDE);
      _WD_CONTROL_REG = 0;

      /* Setup Watchdog for interrupt and not reset, and a approximately 500ms timeout */
      _WD_CONTROL_REG = (1 &lt;&lt; WDIE) | (1 &lt;&lt; WDP2) | (1 &lt;&lt; WDP0);

      interrupts();  // re-enable interrupts
    }

void setup() {
  setup_WDT();
  Serial.begin(9600);
  Serial.println("Startup");
}

void loop() {
}

ISR(WDT_vec) {
  Serial.println("Watchdog Interrupt");
}


The output indicates that the processor is just resetting repeatedly and never reaching the ISR. Also I get the following warning on compilation from the IDE (Arduino 1.8.2):


  warning: 'WDT_vec' appears to be a misspelled signal handler, missing
  __vector prefix [-Wmisspelled-isr]  ISR(WDT_vec) {
Two errors:


The watchdog interrupt vector is named WDT_vect, not WDT_vec.
The statement _WD_CONTROL_REG = 0; serves no useful purpose, and
will likely mess up with the timed sequence for changing the watchdog
setting. Just remove it.