While testing watchdog program with uno and Nano, I noticed that it resets but it fails to reload again, may I know the solution for this ? I tried programming using USBasp, upload 3different Arduino bootloader,but it is not working.
#include <avr/wdt.h>
void setup(){
Serial.begin(9600);
Serial.println("Setup started :");
// make a delay before enable WDT
// this delay help to complete all initial tasks
delay(2000);
wdt_enable(WDTO_4S);
}
void loop(){
Serial.println("LOOP started ! ");
for(int i=0; i<=5; i++){
Serial.print("Loop : ");
Serial.print(i);
Serial.println();
delay(1000);
wdt_reset();
}
//infinity loop to hang MCU
while(1){}
}