I bought a Tiny RTC I2C module and it doesn't work. When i run the TimeRTCSet from TIME library all i get is:
Unable to sync with the RTC
0:00:00 0 0 1970
0:00:01 1 1 1970
0:00:02 1 1 1970
0:00:03 1 1 1970
0:00:04 1 1 1970
0:00:05 1 1 1970
0:00:06 1 1 1970
0:00:07 1 1 1970
The module is connected like this:
Vin -> 5V Gnd -> Gnd SCL -> A5 SDA -> A4
I'm using arduino uno.
I tried with a simple i2c scanner, but it returned two devices!
Scanning...
I2C device found at address 0x50 !
I2C device found at address 0x68 !
done
Only the clock is connected. I tried removing the battery for night to reset it, but it didn't fix it.
Could you help me?
-
1Could you please edit your question to include a link to the I2C RTC you are using.sa_leinad– sa_leinad02/24/2017 09:19:27Commented Feb 24, 2017 at 9:19
-
2The RTC module includes a memory module which is also addressable via I2C hence the 2 addresses. Have you tried sample code like here: elecrow.com/wiki/index.php?title=Tiny_RTC6v6gt– 6v6gt02/24/2017 09:23:44Commented Feb 24, 2017 at 9:23
-
2Looks like the RTC is running correctly but has not been initiated with the current time?Mikael Patel– Mikael Patel02/24/2017 09:58:44Commented Feb 24, 2017 at 9:58
2 Answers 2
Try using the example code from the MD_DS1307 library to find the settings on your RTC, when I first wired mine up the clock was not running and I couldn't set the time on it. After I enabled it, it worked just fine.
-
Thank you for help. I fixed the issue. It was caused by the library which I got from arduino library manager. I deleted it and downloaded the library from github. Now it works great.Velociraptor– Velociraptor02/26/2017 18:00:56Commented Feb 26, 2017 at 18:00
This issue can be fixed by deleting the library downloaded using arduino library manager and replacing it with the library from github.