Hello,
I'm currently working on a project involving the DS1307 RTC. I’ve designed a custom PCB incorporating this RTC, but I'm encountering an issue where the module does not retain the time after power is removed. Instead of maintaining the current time, it resumes from the point where it was last running when power is restored.
Has anyone experienced a similar issue or can suggest potential causes for this behavior? Any insights would be appreciated.
I am using esp32 s.
These are the functions I use to setup and run the rtc on my code :
Note : This code works well and retains the time when using the external rtc DS-1307 module but I face these issues when running the same code on my custom rtc on my PCB.
Well the schematic does not indicate what parts are actually populated.
I can see that R7 is not soldered on.
If you are using a non- rechargeable battery than just connect it to the Bat pin.
As I said all you need is shown in post #5
It's a piece of non volatile memory (4Kb EEPROM) that's put on the board - probably to make the product more appealing to anybody wanting to do a small amount of data logging.
You don't need it. The RTC will work fine by itself.
The AT24 has nothing to do with the DS1307, it's not needed for the DS1307 to function.
Why they put it there? Who knows. Almost everything on the schematic is wrong or make no sense.
Again all you need is what is shown in post #5
Also make sure you are using the correct crystal. It must have a load capacitance of 12.5pF
Can you clarify - does the time freeze when power is lost, and then resume when it is restored? So if it has been running for one hour, then power is lost for 10 minutes, does it lose only the 10 minutes? If so, that's very puzzling. It means the oscillator is turned off when Vcc is missing. Since the DS1307 does not have a register setting that would produce that effect, I think the likely culprit is that 680K resistor R26. When Vcc is missing, that becomes a pull-down resistor, which could stop the crystal from oscillating. I can't think of another explanation. It might even have been a deliberate design. But I would certainly try taking out that resistor.
Well I agree with @jim-p that if you are not using a rechargeable cell, then you should just connect it to Vbat. You should remove R24, R25 and R27, as well as D2.