Firstly thank you for this informative video. It really shows all the different settings of a watchdog timer. For me the "Interrupt" only configuration of the WDT worked fine, but the other two didn't work properly. In both cases "Reset" and "Interrupt+Reset" configurations the reset happened instantly, as if the configured time interval for the WDT was not taken into account. I spent some time in trying to solve this out and found a solution, which is to disable all interrupts with "cli()" before setting the WDT in the "setWDT()" function and ultimately activate all interrupts again with "sei()". Now everything works as intended and hopefully this solution helps others as well.
Hello Sir, I need your help. I want to set watchdog timer for my arduino program. My condition is if digital read pin 5 goes low for max. 8 second then arduino should reset. Please guide me.
Good day. Nice video! I have a question on whether it is possible to do a watchdog timer reset every 30 minutes? If yes, how do I go about changing your code?
se podría utilizar el Watchdog cuando detecte que se fue el internet y toca apagar y prender el moden de la fibra, para que vuelva el internet, yo escuchado con el ping Watchdog pero no se como aplicarlo, tengo el arduino uno, un modulo ethernet y un rele los cuales accedo manual mente y mediante el programa lo apago y prendo lo que busco es hacer automático, en el caso de ayudarme yo le pago
How would I use the watchdog timer with a switch case statement if there are different variable times for the "sleep" period? Would I have to write the code for each case statement for the time? Any help would be greatly appreciated. I'm also using the ATtiny85, so there is some different variations in the libraries. Thanks!
If I understand the question right, you would write the switch statements to set the value of a variable that corresponds to the time interval you want. Then once you have the variable set you feed it to the watchdog timer code
Thank you. Not sure I understand the question, do you mean Eagle CAD software for doing PCB layouts? The WDT is internal to most modern microcontrollers, it is not an external circuit.
The code from this tutorial can be used with AVR based Arduino boards. The Arduino boards are programmed via the Arduino IDE, the code in this video is made for the Arduino IDE. PCB layout software is just for building the circuit for a microcontroller, it does not program the microcontroller
Did anyone of you tried this example in TinkerCAD? For me it didn't work and I was thinking maybe to try it in another simulation software like Fritzing. Any feedback is much appreciated. Thanks.
hi, i am working on a project i wanted to know that i want my sensor system to work only 2-3 hours in a day. and the other time i want it off. could you advise me what to do?
I am not real familiar with the Attiny85, but I believe it is an AVR MCU so if it has a watchdog timer you should be able to leverage from this video. There is also a hardware driven approach for resetting an MCU that I discuss in this video ruclips.net/video/vt9C-hMa1Ok/видео.html
:( it does not work for me. I do a wdt_disable(); at start of the setup then I check the MCUSR & WDRF and reset it, (if it was true I do not play the startup tune) at the end of setup I do wdt_enable(WDTO_4S); but if interupt occours, all that happens is that the LED flickers wildly
To follow-up on my earlier reply: I got rid of the flicker by loading this code using an Atmel IDE via an SPI connection. I have no idea where the hick-up is as I'm a hack.
I liked the dog in the beginning who is angrily watching for the interrupt to come out !!!! But the video does not really explain the issue from the dog. It just uses a library cheat !
i want to add delay of 10 seconds to my action whenever my sensor triggers can i use these for the same purpose ? if yes how please give me hint i m desperately waiting for it.
You could use the watchdog timer for a delay, although I would just recommend using the built-in Arduino function delay() or millis(). You can find examples how to use these on the Arduino website
Firstly thank you for this informative video. It really shows all the different settings of a watchdog timer. For me the "Interrupt" only configuration of the WDT worked fine, but the other two didn't work properly. In both cases "Reset" and "Interrupt+Reset" configurations the reset happened instantly, as if the configured time interval for the WDT was not taken into account.
I spent some time in trying to solve this out and found a solution, which is to disable all interrupts with "cli()" before setting the WDT in the "setWDT()" function and ultimately activate all interrupts again with "sei()". Now everything works as intended and hopefully this solution helps others as well.
Your videos are really good. Probably the best i've ever had the privilege to come across. thank you for your time and effort.
you did that graphic?
This is interesting. Is the watchdog reset similar to pressing the reset button manually?
Yes, same thing
Thank you, i am learning this item and getting al the peaces to getter. :)
Hello Sir,
I need your help.
I want to set watchdog timer for my arduino program.
My condition is if digital read pin 5 goes low for max. 8 second then arduino should reset.
Please guide me.
Great explanation, thanks!
If i understand, the watchdog timer prevents your program of freezing ?
Thanks!
Marc.
Yes, it resets the MCU if it freezes. It also has secondary purposes like serving as a wake up timer when using sleep mode.
thamks
reset from setup() function ?
Thank You.
Marc.
Good day. Nice video! I have a question on whether it is possible to do a watchdog timer reset every 30 minutes? If yes, how do I go about changing your code?
As per the datasheet, the max setting for the watchdog timer on the ATmega328 MCU is 8 seconds
+ForceTronics
If you want 30 mins then just count resets in the isr and only action after 30 mins worth, (use a volatile to store the vount)
Great work. Thanks.
Kudos, very informative!
nice and clear exposition, thanks
on Atmega8A I compile and showing error --'WDTCSR' was not declared in this scope-- in atmega328 no problem
se podría utilizar el Watchdog cuando detecte que se fue el internet y toca apagar y prender el moden de la fibra, para que vuelva el internet, yo escuchado con el ping Watchdog pero no se como aplicarlo, tengo el arduino uno, un modulo ethernet y un rele los cuales accedo manual mente y mediante el programa lo apago y prendo lo que busco es hacer automático, en el caso de ayudarme yo le pago
How would I use the watchdog timer with a switch case statement if there are different variable times for the "sleep" period? Would I have to write the code for each case statement for the time? Any help would be greatly appreciated. I'm also using the ATtiny85, so there is some different variations in the libraries. Thanks!
If I understand the question right, you would write the switch statements to set the value of a variable that corresponds to the time interval you want. Then once you have the variable set you feed it to the watchdog timer code
nice and informative video... can a watchdog timer be designed on eagle or kicad software using this arduino code ?
Thank you
Thank you. Not sure I understand the question, do you mean Eagle CAD software for doing PCB layouts? The WDT is internal to most modern microcontrollers, it is not an external circuit.
ForceTronics yes sir.. I meant eagle CAD software for designing PCB layouts
The code from this tutorial can be used with AVR based Arduino boards. The Arduino boards are programmed via the Arduino IDE, the code in this video is made for the Arduino IDE. PCB layout software is just for building the circuit for a microcontroller, it does not program the microcontroller
lol
Did anyone of you tried this example in TinkerCAD? For me it didn't work and I was thinking maybe to try it in another simulation software like Fritzing. Any feedback is much appreciated. Thanks.
the #include too eyser
hi, i am working on a project
i wanted to know that i want my sensor system to work only 2-3 hours in a day. and the other time i want it off.
could you advise me what to do?
Did you get it to work?
bro that was my project 6 years ago 🤣🤣 I don't remember @@josephdaquila2479
WatchDog reminds me of Spike Dog from TOm and Jerry
Can you help me? I just want to reset my Attiny85 every 5 sek. How can I do this?
I am not real familiar with the Attiny85, but I believe it is an AVR MCU so if it has a watchdog timer you should be able to leverage from this video. There is also a hardware driven approach for resetting an MCU that I discuss in this video ruclips.net/video/vt9C-hMa1Ok/видео.html
ty!
:( it does not work for me. I do a wdt_disable(); at start of the setup then I check the MCUSR & WDRF and reset it, (if it was true I do not play the startup tune)
at the end of setup I do wdt_enable(WDTO_4S);
but if interupt occours, all that happens is that the LED flickers wildly
To follow-up on my earlier reply: I got rid of the flicker by loading this code using an Atmel IDE via an SPI connection. I have no idea where the hick-up is as I'm a hack.
my arduino nano also has this problem, maybe it's a bootloader problem
@@aleceduardo6013 did you try the new bootloader? the old one is explicitly broken in terms of wdt (and then new one is 10x fastern in uploading code)
cool
Interesting video. Can you share your code. Thanks
+Saytinh The link to the code can be found in the video description
+ForceTronics I cannot go to that link "This webpage is not available". Can you check?
+Saytinh The webpage is to my blog and I just tested and it worked. You can always just search "forcetronics blog" and it should come up.
+ForceTronics Still not able to go your blog. Maybe my DNS (I used open DNS 8.8.8.8). But can I go your bog by IP. If can plz give me your IP.
nice doggo:))
I liked the dog in the beginning who is angrily watching for the interrupt to come out !!!! But the video does not really explain the issue from the dog. It just uses a library cheat !
to close to your mic man a little more distance
Sorry, never learned english....
i want to add delay of 10 seconds to my action whenever my sensor triggers can i use these for the same purpose ?
if yes how
please give me hint
i m desperately waiting for it.
You could use the watchdog timer for a delay, although I would just recommend using the built-in Arduino function delay() or millis(). You can find examples how to use these on the Arduino website