Main Site Documentation

RealTime clock stops holding time all of a sudden


#1

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.


Utility.SetLocalTime(RealTimeClock.GetTime());

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.


#2

When ChipworkX does that, can you measure the battery without removing it from the circuit? Even better, measure it before powering up ChipworkX.


#3

Thanks Gus.

I measured the battery voltage in-circuit before powering up and it read 3.1 V. This is the same as when out of the circuit (I said 3 V earlier, but I was just rounding down because I knew 3 V was probably the norm). I also measured it when the ChipworkX was powered up and it also read 3.1 V.


#4

So you have one module that always loses time? Did you try to place the same module in a different board?


#5

No two modules actually. I had not tried them with different boards though. So on your advice I took one of the ChipworkX modules and plugged it into a different (new and unused boards) and it held the time fine. Any thoughts?


#6

Is the board you are using is our DevSys or your own design? Either way, you can try to check for differences between the 2 boards.


#7

It is the FEZ mammoth board GHI made for us.


#8

Try swapping the batteries


#9

I already tried that with no improvement.


#10

So the problem is on the mainboard. I am not exactly sure why but comparing measurements between the 2 boards should show some differences.


#11

I’ll see what I can find out.


#12

Additional information:

I took my second ChipworkX module that wasn’t holding the time while powered off and put it in another mainboard and it then started holding the time while powered off. I then took another ChipworkX module that was holding time while powered up out of the mainboard and put it in this mainboard and it stopped holding time while powered off. So it looks like I have 2 separate mainboards causing this problem. Also this second mainboard with the problem was mounted in the FEZ Cobra OEM Box.


#13

The next test is to put them back, to confirm that the mainboard doesn’t do anything bad to the module. But while they’re in that reversed state, I’d also swap batteries just to be sure.

That then shows that there’s something specific on the mainboard that you can deal with - whether that’s a faulty joint or what I can’t be sure, but probably time to discuss with GHI directly what next.