Skip to main content
deleted 3 characters in body; edited tags; edited title
Source Link
ocrdu
  • 1.8k
  • 3
  • 11
  • 24

WatchDog Watchdog on Arduino Nano - does not recover

I'm trying to add a watchdog on an Arduino Nano, for my code, and I'm following exactlythe code in this manual exactly, but after the amount of time for not resetting the watchdog-, it resets but does not reboot.

AtIn the last paragraph- it says that  :"

However, I could not find something similar in Optiboot bootloader (If I'm wrong, correct me please!), used by Arduino UNO and other new boards. It seems that they sacrificed this check for size. So, it is possible that watchdog timer will be enabled after reset, so - if you set it's value too low, your board may never come out of bootloader stage. So, to be always on the safe side, set watchdog to longer periods (2S and more).

So I've tried for 8s8 s, but still same result.

What is wrong  ?

EDIT1:

#include <avr/wdt.h>
int k=1; 

void setup() {
  Serial.begin(9600);
  wdt_enable(WDTO_8S);
} 

void loop() {
  //do stuff here
  k++;
  wdt_reset();
  Serial.println(1000 * k);
  delay(1000 * k);
 
}

WatchDog on Arduino Nano - does not recover

I'm trying to add a watchdog on an Arduino Nano, for my code, and I'm following exactly code in this manual, but after the amount of time for not resetting the watchdog- it resets but does not reboot.

At last paragraph- it says that  :"

However, I could not find something similar in Optiboot bootloader (If I'm wrong, correct me please!), used by Arduino UNO and other new boards. It seems that they sacrificed this check for size. So, it is possible that watchdog timer will be enabled after reset, so - if you set it's value too low, your board may never come out of bootloader stage. So, to be always on the safe side, set watchdog to longer periods (2S and more).

So I've tried for 8s, but still same result.

What is wrong  ?

EDIT1:

#include <avr/wdt.h>
int k=1;
void setup() {
  Serial.begin(9600);
  wdt_enable(WDTO_8S);
}
void loop() {
  //do stuff here
  k++;
  wdt_reset();
  Serial.println(1000 * k);
  delay(1000 * k);
 
}

Watchdog on Arduino Nano does not recover

I'm trying to add a watchdog on an Arduino Nano, for my code, and I'm following the code in this manual exactly, but after the amount of time for not resetting the watchdog, it resets but does not reboot.

In the last paragraph it says that:

However, I could not find something similar in Optiboot bootloader (If I'm wrong, correct me please!), used by Arduino UNO and other new boards. It seems that they sacrificed this check for size. So, it is possible that watchdog timer will be enabled after reset, so - if you set it's value too low, your board may never come out of bootloader stage. So, to be always on the safe side, set watchdog to longer periods (2S and more).

So I've tried for 8 s, but still same result.

What is wrong?

#include <avr/wdt.h>
int k=1; 

void setup() {
  Serial.begin(9600);
  wdt_enable(WDTO_8S);
} 

void loop() {
  //do stuff here
  k++;
  wdt_reset();
  Serial.println(1000 * k);
  delay(1000 * k);
}
Question Protected by Juraj
added 280 characters in body
Source Link
guyd
  • 1k
  • 2
  • 22
  • 57

I'm trying to add a watchdog on an Arduino Nano, for my code, and I'm following exactly code in this manual, but after the amount of time for not resetting the watchdog- it resets but does not reboot.

At last paragraph- it says that :"

However, I could not find something similar in Optiboot bootloader (If I'm wrong, correct me please!), used by Arduino UNO and other new boards. It seems that they sacrificed this check for size. So, it is possible that watchdog timer will be enabled after reset, so - if you set it's value too low, your board may never come out of bootloader stage. So, to be always on the safe side, set watchdog to longer periods (2S and more).

So I've tried for 8s, but still same result.

What is wrong ?

EDIT1:

#include <avr/wdt.h>
int k=1;
void setup() {
  Serial.begin(9600);
  wdt_enable(WDTO_8S);
}
void loop() {
  //do stuff here
  k++;
  wdt_reset();
  Serial.println(1000 * k);
  delay(1000 * k);

}

I'm trying to add a watchdog on an Arduino Nano, for my code, and I'm following exactly code in this manual, but after the amount of time for not resetting the watchdog- it resets but does not reboot.

At last paragraph- it says that :"

However, I could not find something similar in Optiboot bootloader (If I'm wrong, correct me please!), used by Arduino UNO and other new boards. It seems that they sacrificed this check for size. So, it is possible that watchdog timer will be enabled after reset, so - if you set it's value too low, your board may never come out of bootloader stage. So, to be always on the safe side, set watchdog to longer periods (2S and more).

So I've tried for 8s, but still same result.

What is wrong ?

I'm trying to add a watchdog on an Arduino Nano, for my code, and I'm following exactly code in this manual, but after the amount of time for not resetting the watchdog- it resets but does not reboot.

At last paragraph- it says that :"

However, I could not find something similar in Optiboot bootloader (If I'm wrong, correct me please!), used by Arduino UNO and other new boards. It seems that they sacrificed this check for size. So, it is possible that watchdog timer will be enabled after reset, so - if you set it's value too low, your board may never come out of bootloader stage. So, to be always on the safe side, set watchdog to longer periods (2S and more).

So I've tried for 8s, but still same result.

What is wrong ?

EDIT1:

#include <avr/wdt.h>
int k=1;
void setup() {
  Serial.begin(9600);
  wdt_enable(WDTO_8S);
}
void loop() {
  //do stuff here
  k++;
  wdt_reset();
  Serial.println(1000 * k);
  delay(1000 * k);

}
Source Link
guyd
  • 1k
  • 2
  • 22
  • 57

WatchDog on Arduino Nano - does not recover

I'm trying to add a watchdog on an Arduino Nano, for my code, and I'm following exactly code in this manual, but after the amount of time for not resetting the watchdog- it resets but does not reboot.

At last paragraph- it says that :"

However, I could not find something similar in Optiboot bootloader (If I'm wrong, correct me please!), used by Arduino UNO and other new boards. It seems that they sacrificed this check for size. So, it is possible that watchdog timer will be enabled after reset, so - if you set it's value too low, your board may never come out of bootloader stage. So, to be always on the safe side, set watchdog to longer periods (2S and more).

So I've tried for 8s, but still same result.

What is wrong ?