Week 13: Segment 1: USe of the watchdog timer on the Arduino
This segment focuses on the use of the Arduino 'Watchdog Timer'. This timer is an independently running counter, which has its own 128kHz clock. This timer can be used to reset the Arduino every time it times out (lapses). Time-out times can be set from 16 ms to 8 s. The Watchdog can be reset to zero from the main loop, i.e. a situation can be created where the Watchdog only triggers an interrupt once the main loop stops running properly and the Watchdog is not set back to zero anymore. In this case it times out and a system reset is generated, which restarts the sketch in the main loop. This is a useful feature for making sure that the Arduino keeps running, even if something goes wrong occasionally.
Goals:
Materials for this segment:
|
Main Arduino sketch used in the tutorial:
|