While working with Mbili we used watchdog to wake up from sleep. Currently we have issues with RTCZero (probably previous versions interfering with interrupts) so we were wondering if we could use Watchdog instead?
External interrupts on the IO pins can be used, however, by default only HIGH & LOW are supported in sleep mode. CHANGE, RISING & FALLING require that the source clock and clock provider (GCLK) are set to run in standby (sleep) as well.
There is also the watch-dog timer. https://github.com/SodaqMoja/Sodaq_wdt
The early warning alarm can be used to wake the board.
However, the primary purpose of the watch-dog timer is to reset your board if necessary (if there is some error). You must correctly use the watch-dog reset method otherwise your board will be restarted by the watch-dog timer.
Thank you much Gabriel! We are installing the Autonomos in 3 flooded Forests plots (Patagonia). So from what you just mentioned “external interrupts” would also be a way to avoid a potential clock reset when i go to download the data (monthly) and turn off the system by accident? Do you know how could we avoid this potential risk in the field? Thanks!
When you initialise the RTCZero by calling begin(), there is an optional parameter to force the time to be reset (the default for that parameter is false, send true to force the time to be reset).
The default behaviour of the library is to save the time value and restore it after the initialisation.
If the board is reset due to a Software Reset, External Reset (reset pin), Watch-Dog Reset, or Brown Out Detection Reset, the RTC values, including time, are preserved.
However, if the system is reset by a Power On Reset, the CLOCK registers are reset. The library will try and preserve the time value, however, it will have been reset to zero.
In summary, as long as don’t call rtc.begin() and pass true as the optional parameter, and as long as the board is not completely powered down, the clock time will be preserved .