Im trying to set time on my Tiny RTC module and besides I cant set time on it, it is counting 8 seconds every second. Im using an Arduino Uno, and Im conecting Vcc(DS1307) to 5v(Arduino, testing purposes only), GND to GND, SDA to A4 and SCL to A5. My module has a battery that is OK (3V). I dont know if this is useful information but I have an square wave on SQW of aproximately 32500Hz. I beg for some help because im getting crazy haha.
The module Im using is like this:
and the code I had been using to try to set it on time is the following:
#include <Wire.h>
#include "RTClib.h"
RTC_DS1307 RTC;
void setup () {
Wire.begin();
RTC.begin();
RTC.adjust(DateTime(DATE, TIME));
Serial.begin(9600);
}
void loop(){
DateTime now = RTC.now();Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(' ');
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();
delay(1000);
}
And this is what the Arduino writes on the serial:
2021/10/10 20:40:18
2021/10/10 20:40:26
2021/10/10 20:40:34
2021/10/10 20:40:42
2021/10/10 20:40:50
2021/10/10 20:40:58
2021/10/10 20:40:2
2021/10/10 20:40:10
2021/10/10 20:40:18
.
.
.
and so on...
Can someone tell me what im doing wrong please?