Hello, I am using a pro-mini and a DS3231 module which I'd like to use in order to manage interrupts.
Mine seems to belong to the type with the charging circuit issue
What I did so far:
-Measured Vbat between the Vbat and Ground pin directly on the pin, reading 3,11 V
-Destroyed the charging circuit Diode in order to skip the cargin issue
- Manually included in the Sketch's setup part commands to keep the oscillator register set to low which should keep the oscillator going
Still having, when unplugging and pluggin usb cable, time reset to the value passed when the sketch was firstly uploaded. Of course I do comment the setTime command after uploading the sketch the first time.
I think I am out of bullets right now.
Does anybody have a hint?
Thanks a lot
Including my sketch
#include <Wire.h>
#include <DS3232RTC.h>
#include<TimeLib.h>
DS3232RTC rtc ;
void setup() {
Serial.begin(57600);
delay(3000);
Wire.beginTransmission(0x68);
Wire.write(0xF); // Address the Status register
Wire.write(0x00); // Zero the Status register
Wire.endTransmission();
Wire.beginTransmission(0x68);
Wire.write(0xE); // Address the Status register
Wire.write(0x00); // Zero the Status register
Wire.endTransmission();
Wire.begin();
rtc.begin();
setTime(20, 9, 10, 14, 7, 2020);
}
//------------------------------------------------------------
void loop() {
digitalClockDisplay();
delay(1000);
}
void digitalClockDisplay() {
// digital clock display of the time
Serial.print(hour());
printDigits(minute());
printDigits(second());
Serial.print(" ");
Serial.print(day());
Serial.print(" ");
Serial.print(month());
Serial.print(" ");
Serial.print(year());
Serial.println();
}
void printDigits(int digits) {
// utility function for digital clock display: prints preceding colon and leading 0
Serial.print(":");
if (digits < 10)
Serial.print('0');
Serial.print(digits);
}