I have just gotten a Datalogger shield for use with my Mega2560 board, but when I upload the DS1307 examples from RTCLib, Serial Monitor says "Couldn't find RTC".
When I upload the same code to my Uno, it works perfectly.
What is going wrong?
Which datalogger shield? Problem might be that the shield uses the physical A4 and A5 pins and not the pins marked SDA and SCL. On an Uno, A4 and A5 provide the I2C bus, on the Mega they don't.
Just clip shield pins A4,A5, run jumpers to mega pins 20,21, and you will be OK. You are probably going to have some grief with the SD when you get round to it, but you can solder in a 6-pin socket where the lines are around the pairs of pins and jump to that. This is for the Mega's ICSP cluster.
That did not work.
It still says that it cannot find an RTC.
In fact I even tried to run a I2C Scanner, but it does not see the RTC at all.
I have gotten the SD card working, that isn't an issue at all.
@Nick_Pyner
Nevermind. I had A4 and A5 the wrong way round. ![]()
![]()
![]()
On reflection, you may find that there is a common alternative I2C in the pins nearest the reset switch. Jumpers to pins 20,21 is for older boards.
@Nick_Pyner
Running jumpers to pins 20, 21 works, so maybe mine IS a 'older' board??
It is a clone, so who knows.
Your pictures actually show the labelled pins on Mega and shield. They should work.
@Nick_Pyner
Do you mean without the jumper leads, or as it is (with jumper leads)?
I mean without jumpers, but that assumes that the extra I2C pins are connected to A4,A5, which should be correct since the labelling is there. I'm not familiar with the shield and none of my gear has these extra I2C pins, but the tracks are usually visible enough for you to check this.
@Nick_Pyner
It doesn't look like they are connected to me.
Kind of marked in red; the pins in the headers (not the solder pads) are the I2C bus which is universal for both the Uno and the Mega.


On the shield (after removing it from the Mega), you can measure with a DMM (ohm settings or diode test) if there are connections from those to A4 and A5.
Not connected according to my DMM.
On the Mega, you can check the connections between 20/21 and the header pins marked in red.
@sterretje
Those are connected.
Conclusion?
The conclusion is that post #4 worked beautifully.
My conclusion is that the shield is crap. Possibly not soldered correctly because the header pins are there or those pins are just fake pins.
Sounds about right... It was a $3 shield, so wouldn't surprise me if it complete rubbish...





