Hi everyone, I faced a strange situation. I've connected an ATmega32 to a DS3231 and the circuit works properly. The timekeeping system works well and even after a week of operation, no time change happens.
But if I switch it's power on and off frequently, it's time value increases occasionally. In my last test, I switched the power as 5 seconds on and 5 seconds off; after an hour, the seconds of device increased about 40 seconds. Let me mention that if I connect a constant supply, no problem happens even after a week!
The device has a normal supply with a 3v3 regulator connected to it's VCC pin and a backup battery is connected to its batt pin as well.
The tests are reported below but the problem has not solved yet:
1- I've added a 100nf capacitor to it's supply pins (near the chip)
2- I've changed the supply and connected a precise 5V supply before the 3v3 regulator, but nothing has changed in supply switch mode (5 secs on 5 secs off).
3- I tried to supply the ds3231 chip by the microcontroller and used a pulldown resistor on its VCC pin. So I could've manually turn the DS3231 chip on or off. After applying the input voltage, the microcontroller waits for 1 second and then connects the ds3231 supply voltage and starts to communicate. It definitely removes the "unstable supply voltage" after switch on/off.
4- we also used an original DS3231SN for our work.