I thought I had posted about this before but a quick search of the forum shows nothing. The RTC on my ChipworkX seems to refuse to hold a date. I’ve tested the battery and it’s perfectly fine. Here’s my test code.
using System;
using Microsoft.SPOT;
using GHIElectronics.NETMF.Hardware;
namespace ChipworkXTimeTest
{
public class Program
{
public static void Main()
{
Debug.Print("ChipworkX RTC Test");
Debug.Print("Waiting 3sec for MFDeploy to connect");
System.Threading.Thread.Sleep(3000);
DateTime dtClck = RealTimeClock.GetTime();
DateTime dtComp = new DateTime(2011, 10, 17, 18, 4, 0);
if (dtClck <= dtComp)
{
Debug.Print(">>RTC not set");
RealTimeClock.SetTime(dtComp);
Debug.Print(">>Set RTC for: " + dtComp.ToString());
Debug.Print("");
Debug.Print("Remove power; wait 30sec; apply power");
return;
}
Debug.Print("RTC: " + dtClck.ToString());
}
}
}