How come the value in the RAM of DS1307 RTC become zero


I'm using the 56 bytes of RAM in the DS1307 to store some data. My DS1307 is connected to the PIC18F46K22. But after running a few days, all the data inside the RAM will suddenly become zeros. The time in the RTC is still accurate but it's just that all the data in the RAM has become zero.

I have check my coding but cannot pin point what's the problem. Do you guys have any idea? I did not reset it to zero from my coding.

Best Answer

Since you haven't posted the code or the circuit, we're reduced to making guesses or using our psychic powers. In this case, my guess is that you've wired it up wrongly, and the usual way to do this is to fail to connect something you're not using such as a reset pin.

In the datasheet I see "If a backup supply is not required, VBAT must be grounded" and also "When a backup supply is connected to the device and VCC is below VTP, reads and writes are inhibited. However, the timekeeping function continues unaffected by the lower input voltage".

My guess is that the device is in that state: the timekeeping continues to work, and the data is retained, but the device will not allow you to read it.

Related Topic