Cerbuino RTC help

I have a cerbuino. I placed two AA batteries across the batt and gnd pins of the cerbuino. I have placed a crystal (digikey part ser3205, 32.7680khz, 6.0pf) across digital io pins d3 and d4 of the cerbuino. I added the following code to the main of my applicaiton. The time is not set. The RTC is reporting the time being in year 1980, etc. Can you point me in a direction to get it working. Not sure what to try next.

    public static void Main()
    {
        Debug.Print("Starting Cerbuino");

        RTC.SetTime(new DateTime(2012, 10, 25, 12, 20, 0, 0)); // Set once to set the RTC.
        DateTime dt = RTC.GetTime(); // Get RTC time.
        Utility.SetLocalTime(dt); // Set system clock.

Judging from your picture, the crystal may not be making a very good connection for the RTC to stabilize. I would suggest to maybe solder the crystal to extension pins like a header or to some kind of large wire to make a better connection.

Also see this page on the wiki (http://wiki.tinyclr.com/index.php?title=Cerb-Family#Real_Time_Clock) for an image of what I mean about using extension wires to connect the RTC Crystal.

Thanks I fixed the crystal and the battery as suggested. When I re-ran I got the same results. Year still 1980. I then browsed the RTC class in GHI.OSHW.Hardware and saw the Initialize method. Then I added the call to RTC.Initialize and then the date was set. Year now 2012. Then I played around with the methods and I now am not sure if I really need the call to Initialize.

BTW: I think the crystal was not seen by the cerbuino until I soldered the legs to a wire. Thanks for the suggestion Aron!

So Now I realize the year is correct but the day is not. It is exactly 21 days behind. Very weird! Anyway here is the code I have now

        //RTC.Initialize();
        //RTC.SetTime(new DateTime(2012, 10, 25, 15, 24, 0)); // Set once to set the RTC.
        Utility.SetLocalTime(RTC.GetTime().AddDays(21)); // Set system clock.

Does anyone have an idea why the AddDays(21) is needed? and if the RTC.Initialize is needed?

There is a bug in the Library Function that does not return the correct date. We will be fixing that bug soon for an upcoming release of the OSHW SDK.

As for Initialize, I believe it only needs to be called once to initialize the RTC registers. Once the registers are active, as long as there is proper power to the VBAT, the registers stay active until total power shutdown including the backup battery.

My RTC date is also off, by six days for some odd reason. And yes, you only call Initialize() once. Call it again and you’ll lose data. I’m using this code…

DateTime rtcDate = GHI.OSHW.Hardware.RTC.GetTime();
if (rtcDate.Year < 2013)
{
GHI.OSHW.Hardware.RTC.Initialize();
}

Utility.SetLocalTime(GHI.OSHW.Hardware.RTC.GetTime().AddDays(6));

What version of the firmware are you using?

This is the firmware I have…

ClrInfo.clrVersion: 4.2.0.0
ClrInfo.clrVendorInfo: Copyright GHI Electronics, LLC
ClrInfo.targetFrameworkVersion: 4.2.0.0
SolutionReleaseInfo.solutionVersion: 4.2.3.3
SolutionReleaseInfo.solutionVendorInfo: Copyright (C) GHI Electronics, LLC
SoftwareVersion.BuildDate: Nov 19 2012
SoftwareVersion.CompilerVersion: 410462

It appears to be using the Day of Week instead of the Day when I call GHI.OSHW.Hardware.RTC.SetTime

I looked online and eventually found this page detailing the fix of this bug…
http://ghiopensource.codeplex.com/SourceControl/changeset/22347

So then I checked the version of my GHI.OSHW.Hardware.dll and found I was on 4.2.3.0 instead of 4.2.3.1. I simply removed the DLL from my list of references, re-added it and wala … Eveything is working.

Hi Everyone,

I have a project with Cerbuino, almost completed data logger application battery powered, SD card store. Still working on ENC28 connection.

This application requires RTC, I was going thru the forum, ghi website related pages how to activate RTC. In forum there some links pointing to wiki, thats redirecting us to ghi website:
https://www.ghielectronics.com/docs/46/cerb-family

To make sure I did find all the info, can anyone please give me a summary of all necessary steps to make of activation of RTC on Cerbuino Bee?

What I saw, but confirmation would be greatly appreciated:

  • to add 3V disc battery on BAT pin
  • to add crystal 32.768kHz crystal on ?pins
  • to add 2pcs 8pF capacitors on ???

Thanks a lot in advance,
sandor

Hi Sandor, welcome to the forum.

The page you point to should have all your necessary references, and also includes pictures, although unfortunately not with higher resolution, more detailed images.

to quote:

[quote]To activate RTC you need two hardware changes:

Add crystal on Q2. The frequency of this crystal should be 32.768Khz with load capacitance of 6pF. Here is a part number for a compatible crystal: VT200F-6PF20PPM available from DigiKey
Replace the C21 & C22 caps of Cerb40 (caps C10 & C11 on Cerberus). These need to be replaced with 8pF.

[/quote]

The images don’t help here. I don’t have one to point out where this all goes either. So you should look for some unsoldered points for Q2, and look for C21/C22/C10/C11 and see what they are - take some pics and upload them here and get confirmation before unsoldering/replacing anything ! :slight_smile:

Thanks Brett for your quick response.

Based on topic comments and website photos I attached 2 sketches, probably no soldering will be needed if it can be added to the Arduino style shield.

1, …3D.jpg: Can you please check is it right direction?
2, …Schem.jpg: Are those 2 (C10-C11) capacitors called?, where can I find Q2?

No the shield seems will contain the following things:
(1, opto couples for DI-s)
(2, analog voltage dividers to 3.3V for AI-s)
3, 3V disc battery for RTC
4, 32.768kHz crystal for RTC

Where do yo suggest to connect the 2pcs 8pF capacitors, are they needed?
Anything to adjust in software side to handle well the pins?

Thanks a lot,
sandor

sorry logwood, I think we have to wait for someone else who has a cerb-bee, or GHI, to comment here. Reason is, if you look at the schematic from Cerberus, you can see the RTC capacitors connected to PC14 and PC15, but no such connection shown on the Cerbuino bee schematic.

Thanks Brett,

Yes, you are right.

From forum and the website photo I see the RTC activation possible as per attached sketch.

Can anyone help and confirm? What about 8pF capacitors? What to adjust on software side?

Thanks a lot,
sandor

It wouldn’t hurt to try either way. But to do it right, you need Caps.

ok, thanks Gus.

can you send a schematic or description where to witre the caps?

thanks, best regards,
sandor

Take a look at hydra schematics please.

Thanks Gus,

For wiring I will use the Hydra schematics as per attached sketch, regarding to caps values to stay at 8pF. Isn’t it?

Best regards,
sandor

Yes

Hi,

I’m still working on a Cerbuino project, I use ENC28 for Ethernet access for webserver functions. In DHCP mode already working well, as it is a clear event the the cable is plugged in or not, but how to test that the cable is plugged in static IP mode. Do you know about any event or properties what can tell cable plug status in static mode?

Thanks a lot,
Sandor

When I call the RTC.Initialize() method, the program crashes. I am calling this in the ProgramStarted entry point and when called I continualey get messages in my output window saying

WARN: Total initialization time exceeds xxx seconds

Does anyone know why that call would never return?