# Having problems with DS1307 RTC

#### AlbertHall

Joined Jun 4, 2014
11,235
Why make the assumption that it would not "bother the chip at all"?
Precisely because it is an open drain output. Connecting any kind of load from an open drain output to 0V can have no effect on the chip as no current would flow and use of this signal is optional. From the datasheet:

#### Raymond Genovese

Joined Mar 5, 2016
1,658
Precisely because it is an open drain output. Connecting any kind of load from an open drain output to 0V can have no effect on the chip as no current would flow and use of this signal is optional. From the datasheet:
View attachment 133977
Thanks. I am aware of what an open-drain output is. You may recall that I am the one who brought it up and quoted the data sheet.

Since you think that it can have no effect, it follows that your advice is to leave it as is. My advice, as already stated, is to remove it at this point and continue to debug the problem. We differ in our advice on this matter.

#### Raymond Genovese

Joined Mar 5, 2016
1,658
@abraar_sameer

This is what I would suggest that you do:

1. Remove the resistor and LED from pin 7. Rerun the program. If clock is not responding, go to 2.

2. Remove battery and connections. Jumper Vbat (pin3) to gnd. Rerun the program. If clock is not responding, go to 3.

3. Place a .1uf-1.0uf non-polarized capacitor from pin 4 to pin 8.Rerun the program. If clock is not responding, go to 4.

4. Enter and run the simple sketch below (assuming I didn't mess up something because while I have a bunch of RTCs here none are 1307). If the display shows seconds counting from 0-9. The clock works and somewhere along the line the CH bit got set. If clock is not responding, go to 5.

Code:
#include "Wire.h"

void setup()
{
Wire.begin();
Serial.begin(9600);
Wire.beginTransmission(0x68);
Wire.write(0x00);
Wire.write(0x00);
Wire.endTransmission();
}

void loop() {
Wire.beginTransmission(0x68);
Wire.write(0x00);
Wire.endTransmission();
Wire.requestFrom(0x68, 1);
s=s&0x0f;
Serial.print(s);
delay(10000);
}

5. Look up the capacitance of the crystal that you are using. Make sure it is at least close to what is specified in the DS1307 data sheet.

Still not working? I don't know, I have nothing else. Maybe somebody else does, but, as much as I hate to admit defeat, I would be thinking that the chip is bad.

Hope this helps and please do let us know what happens.

#### abraar_sameer

Joined May 29, 2017
37
I tried removing the LED and connecting VBAT to Ground. But same results. It has retained the time I set yesterday night. I will buy a new chip and let you guys know if it works.

#### Attachments

• 86.5 KB Views: 1

#### abraar_sameer

Joined May 29, 2017
37
Raymond Genovese

I tried all the steps you told but no results. The code gives an output of '0' every time in the serial console. Looks like the chip is dead. I shall buy a new chip and let you guys know if it works.

Thanks to everyone for your help and guidance. I really appreciate it.

#### Raymond Genovese

Joined Mar 5, 2016
1,658
Raymond Genovese

I tried all the steps you told but no results. The code gives an output of '0' every time in the serial console. Looks like the chip is dead. I shall buy a new chip and let you guys know if it works.

Thanks to everyone for your help and guidance. I really appreciate it.
Yeah, looks like the chip is blown or the crystal is dead....or something else that none of has thought about. Please do let us know how it turns out.