For a long time now I've used the following code to reset the arduino uno and mega boards:
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:
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