I2C RTC and Master Writer Issue

Hello,

I am using an arduino mega to send an array of temperature sensors to an arduino uno via i2c, which is working fine in solitary. I also want this arduino mega to get a time from a ds1307 rtc for display on a screen. The mega was getting the time from the RTC using setSyncProvider(RTC.get) in setup() and then using the time library function such as minute() in the main loop - this was also working fine in solitary. However, when I tried to merge the two functions together the code is no longer functional after the setup, resulting in a significant slow down and eventual stopping in the main loop.

I am relatively new to Arduino and the coding environment but am assuming that this slow down has to do with a possible master/slave issue on I2C. The address of the Uno has been set as 4 and the default address of the RTC is different (I looked up the Maxim datasheet).

I would attach the code but the main file is large (>900 lines) so I am putting this up here to see if anyone else had a similar issue first before editing the code down to a minimal and (understandable!) file!

Any help appreciated!
Thanks
Aodhgan

Can you share us your setup diagram . How you connected Master slave configuration.

However, when I tried to merge the two functions together the code is no longer functional after the setup, resulting in a significant slow down and eventual stopping in the main loop.

Which two function talking about. unless you post your code . How could we say which functions

What you are trying do explain properly

  1. which is your master and slave here
    2)To which Device RTC being connected
    3)When you have RTC DS1307 Why you using timer of controller???

Hi Aodhgan

I would attach the code but the main file is large (>900 lines) so I am putting this up here to see if anyone else had a similar issue first before editing the code down to a minimal and (understandable!) file!

Good to edit down to the minimum that shows the problem. If you need to post a large file, though, you can attach it through the Additional Options button under the text entry window in a post.

Just to clarify, the Mega is the I2C master and the Uno and RTC are slaves?

Regards

Ray