High, I'm using a nano to control an automatic greenhouse system for temperature control, irrigation ad ventilation, which also includes door entry and exit. Everything works fine and as a novice to programming and using arduino's I'm quite chuffed with my efforts. Can anybody advise me regarding the addition of a watchdog timer, should for any reason the program crash! If so what would be the simplest way of going about it and maybe a code example could be useful.
it may crash depending (if i remember correctly) on installed bootloader. I think that with "optiboot" there is no problem. There have been noumerous discussions. Search in forum for "nano watchdog".
There are numerous examples and guides on the subject online, here's one..
Danois90:
There are numerous examples and guides on the subject online, here's one..
That's great thanks, a clearer understanding and the examples will help me also. Thank you
GRuser:
it may crash depending (if i remember correctly) on installed bootloader. I think that with "optiboot" there is no problem. There have been noumerous discussions. Search in forum for "nano watchdog".
Thanks I'll take a look
The official Arduino Nanos manufactured before 2018 and all unofficial Nanos I've seen have a bug in their bootloader that causes them to be "bricked" by going into an endless reset loop after a watchdog reset:
If your Nano has this bootloader then you can't use the watchdog reset.
Official Arduino Nanos manufactured from 2018 onward have an updated bootloader that doesn't have this bug. These are safe to use with the watchdog reset.
If you don't know whether your board has the buggy bootloader or not, here's how you can determine it: If you are using Arduino AVR Boards 1.6.22 or newer (check in Tools > Boards Manager if you don't know) and need to select Tools > Processor > ATmega328P (Old Bootloader) to upload, then you have the old bootloader with the bug. If you are using Arduino AVR Boards 1.6.21 or older and you can upload to your Nano then you have the old bootloader with the bug.