Arduino Expansion Shield for Raspberry Pi B+ (DFR0327) RTC not accessible

Hi, I’m trying to access the on-board RTC of the “Arduino Expansion Shield for Raspberry Pi B+” (SKU: DFR0327), and the hwclock is failing to read it, while the “i2cdetect -y 1” is showing “UU” on the address 0x68. The appropriate modules are loaded, and another board with just an RTC using the same chip is working when I connect just that one instead.
When I remove the Arduino Expansion Shield, the “i2cdetect -y 1” command shows nothing on that address, and when I used a direct I2C access from the Arduino side to read the RTC (I don’t know yet if it’s actually connected to the appropriate pins), it was reading just 0xFF 0xFF… for the time/date. Most likely that needs to be jumpered on board to work, and I’ll try that out soon, along with an oscilloscope to debug it, but has anyone come across it again? Could it be just as simple as a dead CR1220 battery causing it?

When I tried to connect the oscilloscope on the I2C to check why the RTC clock wasn’t working, it suddenly worked just fine! You can see on the screenshots the I2C decoding of the oscilloscope, and the simple python program I wrote to read the RTC’s date and time.
On the oscilloscope’s screenshot, the first byte is a zero written on address 0x68, and the following bytes are the RTC’s response (in BCD format):

32:35:08:04:08:02:23 translated below

"SS:MM:HH" for the time (08:35:32 AM UTC), 
followed by the "day of the week" (04 = Wed), 
and finally the date as "dd/mm/yy" (08/02/23).

I still don’t know why it wasn’t working for the first couple of days, since I didn’t change anything, unless it was a bad contact on the I2C pins or something…

Hi Soefoklis,

That is a weird one! What impedance is your scope set to? I’m sure you’ve got it nice and high, but perhaps it’s acting as a weak pulldown and fixing some problem with an I2C device’s driver :thinking:

Has it come good even without the scope connected?

I hope the rest of your project goes smoothly now!

Hi James

I have the Arduino Shield connected on top of a SenseHAT on the Raspberry Pi, which has thinner than usual pins on the 40 pin header, so my guess is that the SCL or the SDA simply wasn’t making good contact all the other times when I was trying it. I was using the SenseHAT as a spacer, because the Arduino Shield would not fit directly on top of the Pi’s case (Argon NEO for Raspberry Pi 4, SKU: CE06587).
When I went home and I tried it, I had the oscilloscope connected on the first try, so I didn’t see it fail first, and work later with the oscilloscope on it.
It works fine ever since, that’s why my verdict was that it should’ve been most likely a 40 pin header contact issue.
Another possibility would’ve been the combined power consumption of the SenseHAT and the Arduino Shield along with the Raspberry Pi 4 itself. The power supply that I use was giving only 12W on that USB port.

However it’s working well ever since. If it does it again, I’ll try first a different power supply with more watts, or I’ll just connect it straight on another Raspberry Pi altogether, which has no case to interfere, using the same SD card.

Thanks for the quick response,
Sofoklis