Go Down

Topic: Why Watch dog timer program is not working for UN0 and Nano? (Read 2290 times) previous topic - next topic

amaraxr

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){}
}

TheUNOGuy

Please Explain what library you are using and what you are trying to achieve.
Success lies within hard work.

microjack64

first of all you check led is connected correct
and what is time delay you set for watch dog time ?

Received his L.S. Degree in Electronics & Communication in 2013 from University of Psa,  Master's Degree in Electrical Engineering from Capital University of science and technology
https://

Go Up