Hi, I have made a small module that increments time just fine, but only when there is no battery inserted. As soon as the battery is installed it shows just 0s. Take it out and it starts up again.
The schematic is fine and all connections have been fully checked and tested.
This has been driving me mad for hours now, I have tried 3 fresh batterys straight from the packet.
Well that is not so much a schematic simply a collection of components with little wiring up information.
You need pull up resistors on pins 5, 6 & 7 as shown on the data sheet.
Is the ground connected to the ground of the arduino?
Have you measured the battery to make sure you haven't misidentified the polarity?
Right, with fresh eyes it appears that when the battery is in and the power is disconnected it does store the time and when the power is reconnected and battery removed it shows the time in the serial monitor again. But as you can see below, while the battery is in it wont show the time in the serial monitor:
What voltage battery are you using?
It could be it is too high causing the chip not to come out of the power mode when supplied with 5V.
The data sheet says it should be between 2 and 3.5V preferably 3v.
Its running at 3.01v. Im thinking a better quality battery may help and I will build a second module with the spare ds1307 to see if the chip is at fault. These batterys are ebay specials.
Im just waiting for the etchant to finish its job then will test the second ds1307, I have change the crystal, triple checked board diagram and even changed the filter cap.
It does everything except show the time when the battery is in.
I'll use this theme to say for a problem with the DS1307. I'm using this scheme, already tried 2-3 different examples and it doesn't work. Could the IC be damaged?
Polarity is definatly correct, vbat is left floating when the battery is removed.
Like I said, it all seems to work ok(stores time when power is lost, continues ticking away) but when the battery is installed the serial monitor only shows 0s.
I just wired up (on a breadboard) the schematic linked above, using the code from the playground. I cannot reproduce your problem... assuming your wiring is correct, and the code is correct, I can only guess that the chip is bad...