Go Down

Topic: Using Sparkfun DS1307 Module with Arduino Uno (Read 2 times) previous topic - next topic

tecs

I have the sparkfun DS1307 module hooked to my Arduino Uno on analog pins 4 and 5 that same as this diagram http://bildr.org/2011/03/ds1307-arduino.  When I start it up and use the code from the Time library to read it reads noon Jan 1 1999.  This works fine, however when I try to set the time using the other example sketch provided in the library i get the right time until i close and reopen the serial monitor or turn off everything and turn it back on.  If I do either of those things the the time goes back to 1999.  Any ideas what could be wrong? Thanks

CharlieD

Are you sure the battery is correct ? - voltage present when power is off, is there even a battery on this module ? - the 1307 needs a battery to mantain time when the power is off ...

tecs

Here is what I have: http://www.sparkfun.com/products/99
It came with a battery.  I dont think its bad because even when I leave it on and plugged into the arduino and just restart the serial monitor it resets the time back to 1999.  I will check the battery just to be sure though...

tecs


battery was fine it was a wiring problem with the voltage. everything is working fine now

WanaGo

Bringing this up again.

Just a query about the battery. I have a DS1307 on a test board without a battery. Can someone tell me why when opening the serial monitor etc the time does reset back to default?
The power to the module hasnt turned off, simply the micro has been reset due to opening the serial monitor, so why would that effect the DS1307 to make it loose the current time?

Just a little confused. I would have thought the DS1307 would start up, you could set the time, and then program the uC as many times as you like - keeping the power to the DS1307 at all times, and the time would stay put and stay counting from the time it was set... but it doesnt seem to be the case, in my case.

If someone can set me straight that would be helpful.

Thanks

tkbyd

If you are running the 1307 without a battery, you may be relying on the 1-Wire trick of "stealing" power from the 1307's data line. And during a system reset, that data line may be low for so long that the 1307 can't "hold it's breath" that long.

Try what you've been doing WITH a battery on the 1307, and tell us what you see?

Go Up