I had this working fine for a few days but now my DS3231 is spitting out odd times at me. I've tried resetting the time which gives the proper one for the first output but after spits out things like this in the serial port:
Date : 25/12/2019 Hour : 12:30.0
Date : 0/0/1920 Hour : 0:0.0
Date : 80/2/1930 Hour : 0:88.22
Date : 19/0/1900 Hour : 25:0.12
Date : 20/22/1988 Hour : 0:0.0
Date : 30/12/1900 Hour : 80:20.0
Date : 0/0/1900 Hour : 19:92.25
Date : 88/0/1920 Hour : 20:0.0
Date : 0/5/1992 Hour : 30:8.80
I'm thinking it may be a bad module but is there any fix to this?
Try reading the RTC registers directly without any further processing to see if it's your code or your hardware. Alternatively, the libraries that support a DS3231 usually have example code you can use to see if your RTC is working.
No wonder you keep your code secret, it's probably terrible, and you are trying to blame the module.
That was what it spit out with the test code, I did end up needing to swap out the kit due to issues with the mega board but all is working well now. This project was for a neopixel LED clock and some other lamp automation, the code is quite a mess but if anyone wanted to see what I'm working on here it is: