text: I was expecting this to be a no-brainer. I use WDT on Arduinos w/o any trouble. The code for Arduino would roughly be:
  #include <arv/wdt.h> ... wdt_enable(WDTO_1s); while (true) {}
  After one second, the arduino reboots because of the WDT.
  That does not work for the ATTiny85. It wants to call the WDT_vect ISR instead and somehow (at least for me) hangs up such that I have to remove power from the ATTiny85 to get it running again.
  After hours of banging my head against the wall and searching every source repeatedly I finally was able to put together the following code which correctly reboots the ATTiny85:
  #include <avr/wdt.h> void reboot( ) { cli(); WDTCR = 0xD8 | WDTO_1S; sei(); wdt_reset(); while (true) {} } //reboot void setup ( ) { wdt_disable(); }
  In this example, the WDIE bit is set to 1 which is necessary to get the MCU to reset. Evidently wdt_enable() is not doing that for the ATTiny85. The other possibility is that the wdt_enable() procedure is not fast enough as the ATTiny85 requires everything be set properly in 4 clock cycles.
  Note: You MUST include wdt_disable() as the first instruction in setup(). I tried going without this and it hangs under that condition as well.
  Either way, this code is working for me, so after 2 evenings of frustration, I can proceed with my project!
  hi, your code didn’t work for my ATtiny85 (programmed using an Arduino Uno as ISP) but the following did. the main difference is that MCUSR &= ~(1<<WDRF) needs to be set before wdt_disable() in your setup code, so it's the first thing that's executed.
  void setup() {
  MCUSR &= ~(1<<WDRF); // reset status flag
  wdt_disable();
  //… other stuff
  }
  void loop() {
  if (some-condition) reboot2();
  }
  void reboot2() {
  wdt_enable(WDTO_2S);
  while(1){};
  }
  I’m using an Adafruit Trinket Pro 3V. Here’s my variation that works for me:
  #include
  void reboot() {
  wdt_reset();
  wdt_enable(WDTO_15MS);
  while (true) {}
  } //reboot
  void setup () {
  wdt_disable();
  }