After a month or two of use, the real time clock in my ChipworkX has stopped holding the time when power is off even for a few seconds. I’ve checked the voltage on the battery and it is showing 3 V. I’ve even tried a new batter with the same problem.
Below is the code used to set the time from some text boxes. I also have an option to retrieve it from an NTP server, but this demonstrates it a bit better.
DateTime dt = new DateTime(Int32.Parse(txtYear.Text), Int32.Parse(txtMonth.Text),Int32.Parse(txtDay.Text), Int32.Parse(txtHour.Text), Int32.Parse(txtMinute.Text), Int32.Parse(txtSecond.Text)); RealTimeClock.SetTime(dt); Microsoft.SPOT.Hardware.Utility.SetLocalTime(RealTimeClock.GetTime());
At this point the time holds fine, but if the device is off for even a few seconds, the time is off when it boots back up. Below is the code called on startup of the ChipworkX.
This has worked fine for quite a while (time would be correct if device was off for several days) and all of sudden the other day it stopped holding the time (even with a good battery). This also happened to another ChipworkX I use for testing a few months ago but just chalked it up to a problem with that particular ChipworkX and didn’t worry about it. Now that it has happened to a second ChipworkX I am not sure. Could it be something else I’ve done. The current ChipworkX has been re-booted many times during the course of testing.