One kludge is the Arduino's core library, which disables the watchdog, after which it cannot be reenabled. To overcome this, edit hardware/arduino/sam/variants/arduino_due_x/variants.cpp and remove (comment) the line reading WDT_Disable(). This is my tiny watchdog class. The watchdog can be configures once by specifying a timeout period in milliseconds, which has to be between 4 ms and 16 seconds in a granularity of 4 ms. The reset function must be called inside loop() and at a rate faster than the timeout period, or the watchdog will automatically reset the CPU.
The implementation is simple: Update: The Arduino folks seem to have reacted to the kludge, and have made the watchdog accessible in the newest core library revision 1.6.5. [1]
References
- http://forum.arduino.cc/index.php?topic=350058.msg2416416#msg2416416
No comments:
Post a Comment