Can you identify this?

Pop quiz, what does this code do?

DS1307 d = new DS1307(Cpu.Pin.GPIO20_VTU_TIO1A, Cpu.Pin.GPIO21_VTU_TIO2A);
d.SetRTC(new DateTime(2005, 2, 2, 21, 22, 0, 0));
for (int i = 0; i < 10; i++)
DateTime dt = d.ReadRTC();
Debug.Print(dt.Hour + “:” + dt.Minute + “:” + dt.Second);

Okay, so it’s not too exciting, until you realize that what it calls – an I2C driver – is written in C# as well.  Yes, I’ve achieved a managed code driver.  Next question – what’s it run on?  I’ll give you a hint – it’s not a Pocket PC.

4 thoughts on “Can you identify this?”

  1. Hi!

    I am trying to get some info on how to get I2C working in .NET. I have a digital compass that supplies data in I2C and I need to read the data off of this device.

    I have not found any information regarding this besides the snippet of code you have posted which mentions that you are using I2C.

    This is a very important project for me and I would appreciate your help.



  2. That greatly depends on a lot of things.

    1. What OS are you running (CE or desktop or TinyCLR)?
    2. If it’s CE, does your device OEM have a driver?
    3. If you have no driver, do you have available access to GPIOs?

    It may be difficult or it may be simple – without knowing your environment I can’t say.


  3. Hey there!

    thanks for replying to my question.

    Ok, I will be running a desktop OS, WindowsXP. I intend to use VB.NET or C# to write the programs.

    Thats the information I have for now, but I would definitely need your help to get this working.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s