interfacing DS1682 Elapsed time counter

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);
}

Check the I2c scanner of Nick Gammon - Gammon Forum : Electronics : Microprocessors : I2C - Two-Wire Peripheral Interface - for Arduino - somewhere on this page to see if the device is reachable.

Do you have pullups on the I2C lines?

try
Serial.println(second, DEC); // force decimal interpretation of the return value.

If there is a negative value it will be printed too ...

Thanks for the link really a good one , ya i have pull ups in I2C lines

void printData()
{
Wire.beginTransmission(DS1682_ADDRESS); // DS1682_ADDRESS = 0x6B
Wire.send(0);
Wire.requestFrom(DS1682_ADDRESS, 10);
Wire.endTransmission();

int Alarm1 = (Wire.receive());
int Alarm2 = (Wire.receive());
int Alarm3 = (Wire.receive());
int Alarm4 = (Wire.receive());
int ETC1 = (Wire.receive());
int ETC2 = (Wire.receive());
int ETC3 = (Wire.receive());
int ETC4 = (Wire.receive());
int EC1 = (Wire.receive());
int EC2 = (Wire.receive());

Serial.print(Alarm1);
Serial.print("/");
Serial.print(Alarm2);
Serial.print("/");
Serial.print(Alarm3);
Serial.print(" ");
Serial.print(Alarm4);
Serial.print(":");
Serial.print(ETC1);
Serial.print(":");
Serial.print(ETC2);
Serial.print(":");
Serial.print(ETC3);
Serial.print(":");
Serial.print(ETC4);
Serial.println(" ");
Serial.print(":");
Serial.println(EC1);
Serial.print(":");
Serial.println(EC2);
Serial.print(":");
}

PLease modify your post, select the code part and pres the # button. Does change the quality but it looks so much better :wink:

Does this code work?
if yes what is the output it generates?

here is the full working code , i missed the config address last posting, it is generating the secs count .

void printData()
{
long int tmp;
Wire.beginTransmission(DS1682_ADDRESS);
Wire.send(0);
Wire.requestFrom(DS1682_ADDRESS, 10);
Wire.endTransmission();

int cnef = (Wire.receive());
int Alarm1 = (Wire.receive());
int Alarm2 = (Wire.receive());
int Alarm3 = (Wire.receive());
int Alarm4 = (Wire.receive());
int ETC1 = (Wire.receive());
int ETC2 = (Wire.receive());
int ETC3 = (Wire.receive());
int ETC4 = (Wire.receive());
int EC1 = (Wire.receive());
int EC2 = (Wire.receive());

tmp = ((long int) ETC4 << 24) + ((long int) ETC3<< 16) + ((long int)ETC2 << 08) + (long int) ETC1 ;
//Serial.print(tmp,DEC);
//Serial.print(":");
long int output1;
output1 = tmp/4; // to convert the quarter seconds to seconds
long int runhour = output1 / 3600; // Hour calculation
int output2 = output1%3600; // for modulo taking
int minutes = output2 /60; // for minutes
int seconds = output2 % 60 ; // for seconds
Serial.print(runhour);
Serial.print(":");
Serial.print(minutes);
Serial.print(":");
Serial.print(seconds);
}