I use the examples in the Time library, eg. TimeRTCSet. When I set the time with a time command from the serial monitor, the time is set correctly. But when I read it back after resetting Arduino, it always starts with 17:18:09 27 2 2037 which is also the value it starts with even when I remove the RTC module completely. So the RTC doesn't do much in my setup.

SCL is connected to A5 and SDA to A4. And the CR2032 is inserted in its holder.

When I connect my LCD scope to SCL and SDA I see a constant high value. No impulses to see whatsoever. Now I don't know much about the I2C protocol, but I would assume that I could see "something" on these pins, right?

I would very much like to test if the RTC module is working or not. Any ideas how?

OK this is not meant to be funny so, if your code is kosher, hear me out. I believe I have traced my sudden RTC problems to the motherboard in my desktop.

I fixed it by using a 9v wall-wart for power instead of the USB cable. If you are using a USB cable, you could have the same problem.

There has been prior evidence that my USB supply has been close to the edge. I have just had to replace the mobo and it appears that the new one is just that much short of grunt. If things are marginal, it could be that the LCD is the villain in the act, most particularly the backlight in a 16x2 display. In that event, you might find the proof by removing the LCD and getting output from serial instead.

I went to bed after starting this thread. When I tried this morning, the RTC worked!

rbright suggests waiting 30 secs before inserting the battery. Although I can't know for sure, perhaps I didn't remove it for long enough yesterday. Probably only like 10 secs which normally is enough for electronics stuff to "pass out". But I know that I left the module without battery overnight and that might have done it.

Jack Christensen's trick to power it from the analog pins is neat as I can simply insert the module in the connector. Thanks! Can I do the same from the digital pins? That is, power low-power devices instead of using 5v and Gnd?

TimeRTCSet is compiling fine under Arduino 1.0. No problems here.

Btw, I noticed that when the module works correctly but the time has not been set, it starts with 00:00:00 1-1-2000. When the module doesn't work or is not connected, the start time is 17:18:09 27 2 2037. I thought that the library would detect that the module wasn't present, but apparently not.

Jack Christensen's trick to power it from the analog pins is neat as I can simply insert the module in the connector. Thanks! Can I do the same from the digital pins? That is, power low-power devices instead of using 5v and Gnd?

Can't take credit, saw it on Adafruit's site. But yes digital pins would work as well, just stay within the current limitations of the microcontroller, 20mA per pin to be conservative. Analog pins can be used just like digital pins.

Quote

Btw, I noticed that when the module works correctly but the time has not been set, it starts with 00:00:00 1-1-2000. When the module doesn't work or is not connected, the start time is 17:18:09 27 2 2037. I thought that the library would detect that the module wasn't present, but apparently not.

/* * TimeRTCSet.pde * example code illustrating Time library with Real Time Clock. * * RTC clock is set in response to serial port time message * A Processing example sketch to set the time is inclided in the download */