Hi,
Has anyone come across something like this before ...
It is a simple I2C connection between an ESP32 and a DS3231 (typical one to be found on e-bay)
The code, simplified. (extraneous stuff removed until needed) :
#include <RTClib.h>
RTC_DS3231 rtc ;
setup() {
Wire.begin() ;
Serial.begin(115200);
In_a _sub {
if(!rtc.begin()) {
Serial.println("Couldn't find RTC!");
return false ;
}
OK. here is the problem ...
rtc.begin() fails.
BUT ...
Running I2CScanner (within my setup() routine before attempting to initialise the clock identifies something at 0x68 (my Clock))
Clock initialisation fails with an I2C timeout error and other of related failure messages
THEN ...
Asking RTC for the time later returns just what one would expect - THE TIME! (according to itself! But not set with my values))
It is as though I have the worlds first "read only" (DS3231) clock!
The current time is ... "whatever time I have available from ages ago" (so RTC is actually working, sort of)...
Should I ...
a) keep on trying to "debug" my code and work out what is going on
b) Just buy a new one?
Is it even possible that the (I2C) R/W bit is not happening?