Hi, all!
I connect DS1307 rtc module to arduino mega 2560. But I use CRIUS AIOP flight controller as Arduino... so it have PCA9306 onboard level converter on I2C bus... I tried to connect module before and after converter - same result...
I have tried different RTC libraries and get same result: get wrong time.
Also i have tried Arduino on Atmega328P and all works fine...
You have clearly ruled out the possibility that the RTC modules is simply set with the wrong time ?
Have you removed the battery, waited and put it back to see if you get different results ?
6v6gt:
You have clearly ruled out the possibility that the RTC modules is simply set with the wrong time ?
Have you removed the battery, waited and put it back to see if you get different results ?
6v6gt, in the code time outputs to serial each second… but look at seconds… 0 1 0 1 4 5 4 5 …
Yeah, i have tried to remove battery… same result.
OK. You get good results with the DS1307 connected to a Uno, but not when connected to the CRIUS AIOP.
Maybe it is an I2C bus address conflict. DS1307 has an I2C address of 0x68. You could test this by removing the DS1307 from the CRIUS AIOP and running an I2C scanner on it to see if something else is still using this address.
6v6gt:
OK. You get good results with the DS1307 connected to a Uno, but not when connected to the CRIUS AIOP.
Maybe it is an I2C bus address conflict. DS1307 has an I2C address of 0x68. You could test this by removing the DS1307 from the CRIUS AIOP and running an I2C scanner on it to see if something else is still using this address.
I just desoldered PCA9306 level converter from CRIUS board(it means that i have disconnected all other devices from I2C bus) and now DS1307 works well...
So... if there is an address conflict how can i resolve it?
I will try to solder level converter back and try to run I2C scanner.