Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ Electronics ➜ Microprocessors ➜ interfacing DS1682 Elapsed time counter

interfacing DS1682 Elapsed time counter

Postings by administrators only.

Refresh page


Posted by Pragadheeswaran   (1 post)  Bio
Date Mon 26 Sep 2011 02:19 PM (UTC)
Message
I am interfacing the DS1682 Elapsed Time counter with i2c interface , but it is not seems to be working any one please help me , my part code is below ...

void printetc()
{
Wire.beginTransmission(0b1101011);
Wire.send(0x09);
Wire.send (0b11010111);
int second = Wire.receive();
Wire.endTransmission();
Serial.println(second);
}

But it identify s the device and its address , hope i am missing something big .
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 26 Sep 2011 10:11 PM (UTC)
Message
I prefer to answer general questions about the Arduino on the Arduino forum, that way the knowledge-base isn't split across multiple sites.

http://arduino.cc/forum/

However something obviously wrong is that you have to do endTransmission before doing a receive. That is:


void printetc()
{
Wire.beginTransmission(0b1101011);
Wire.send(0x09);
Wire.send (0b11010111);
Wire.endTransmission();

int second = Wire.receive();
Serial.println(second);
}


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


11,490 views.

Postings by administrators only.

Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.