Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Toolbox.NETMF.Hardware.DS1307 problem


Best Answer cce1911, 31 July 2013 - 04:26 AM

It looks like this wiring diagram may have been for the N+: http://netmftoolbox....ailable classes

 

The N+2 has pins SC and SD. When I wired my RTC to these pins, everything worked.

Go to the full post


  • Please log in to reply
1 reply to this topic

#1 cce1911

cce1911

    Advanced Member

  • Members
  • PipPipPip
  • 71 posts
  • LocationGeorgia, USA

Posted 30 July 2013 - 07:16 PM

I purchased this RTC: http://www.adafruit.com/products/264

 

But when I go to set the time using the Toolbox.NETMF.Hardware.DS1307 I get the following error:

"Something went wrong setting the time. Did you use proper pull-up resistors and is there a 3V battery connected?"

 

The wiring is pretty simple and I've double checked it (see pic).The kit has the resistors and the battery, any ideas?

 

Here is the code where it fails:

DS1307 RTC = new DS1307();

RTC.SetTime(2013, 7, 29, 23, 14, 0);

 

here is the toolbox code where the call is throwing an exception

public void SetTime(DateTime Time)

{

// Writing 7 bytes to the buffer, starting at address 0

int BytesTransferred = this._Device.Write(new byte[] {

0x00,

(byte)Tools.Hex2Dec(Time.Second.ToString()),

(byte)Tools.Hex2Dec(Time.Minute.ToString()),

(byte)Tools.Hex2Dec(Time.Hour.ToString()),

(byte)Tools.Hex2Dec(((int)Time.DayOfWeek).ToString()),

(byte)Tools.Hex2Dec(Time.Day.ToString()),

(byte)Tools.Hex2Dec(Time.Month.ToString()),

(byte)Tools.Hex2Dec((Time.Year - 2000).ToString())

});

if (BytesTransferred != 8) throw new ApplicationException("Something went wrong setting the time. Did you use proper pull-up resistors and is there a 3V battery connected?");

}

 

 

Attached Files

  • Attached File  1307.jpg   211.82KB   5 downloads


#2 cce1911

cce1911

    Advanced Member

  • Members
  • PipPipPip
  • 71 posts
  • LocationGeorgia, USA

Posted 31 July 2013 - 04:26 AM   Best Answer

It looks like this wiring diagram may have been for the N+: http://netmftoolbox....ailable classes

 

The N+2 has pins SC and SD. When I wired my RTC to these pins, everything worked.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.