Go Down

Topic: Watch Dog Reset (Read 232 times) previous topic - next topic

daufderh

For a long time now I've used the following code to reset the arduino uno and mega  boards:

Code: [Select]

void Reboot()
{
  wdt_enable(WDTO_15MS);
  while(1)
  {
    // Nothing to do but wait
  }
}


I've recently gotten a batch of Chinese boards that this does not work on.  I just spin forever in the while(1) loop

I've replaced it with this code:
Code: [Select]

void Reboot()
{
  asm volatile("jmp 0");
}


but I really prefer the watch dog way as its more of a hard reboot.  Anybody have any ideas on why the watch dog wouldn't work?

Thanks
Dave

Go Up