Does WDTZero software timer effect RTC on MKR1000?

I have a MKR1000 project that’s been in use for a couple of years and generally works well. It uses the RTC to send out a status SMS at 10AM and 10PM every day. And all of that was great. There could be a slight deviation (max. 1 minute) 10:00AM & 10:00PM each day, attributed to the time it takes to get the SMS through Twilio and to my iPhone. But the deviation does NOT accumulate, even over weeks or months.

But every once in a while (weeks to a couple of months), the project would lock up and need to be reset.

So I decided to add a software WDT in setup():

WatchDogTimer.attachShutdown(WatchDogFired);
WatchDogTimer.setup(WDT_SOFTCYCLE8S);  

And I reset the watchdog every second with:

WatchDogTime.clear(); 

Now, it looks like the RTC is being affected and appears to be losing time. The status SMS messages are delayed by about 3 minutes per day and accumulates:

Day 1: 10:00AM 10:00PM

Day 2: 10:03AM 10:03PM

Day 3: 10:06AM 10:06PM

Day 4: 10:09AM 10:13PM

Day 5: 10:17AM (that’s today)

This also accounts for something else I was seeing in another project that uses the WDT and couldn’t figure out - it’s time also gets screwed up and up until now I couldn’t attribute it to the WDT - now I think I can.

Any idea what’s happening and how to fix it?

Thank you.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.