I'm using an ESP32 which I connected to a MAX31329 RTC through I2C.
Unfortunately I can't read any register from the RTC. After modifying the MAX31328 library didn't work, I tried reading single registers directly. Here is the code:
#include "Wire.h"
int seconds = 0;
int ret = 0;
void setup() {
Serial.begin(115200);
delay(500);
Wire.begin(33,32,100000);
delay(500);
Wire.beginTransmission(0x68);
Wire.write(0x06);
Wire.write(13);
ret = Wire.endTransmission();
if(ret != 0)
Serial.println("i2c Setup failed");
delay(500);
}
void loop() {
Wire.beginTransmission(0x68);
Wire.write(0x06);
Wire.requestFrom(0x68,1);
seconds = Wire.read();
ret = Wire.endTransmission();
if(ret != 0)
Serial.println("Read failed");
Serial.println(seconds);
delay(1000);
}
The register always returns 0.
Do you see the error in my code? The datasheet of the MAX31329 can be found here.
I'm trying for days now and have no clue what the problem is. Thanks a lot for your support in advance.
Best regards,
Martin