Ds1307 Not moving forward while arduino powered off
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 23
- Joined: Tue Jun 15, 2010 8:36 am
-
- Posts: 10
- Joined: Wed Dec 08, 2010 10:58 pm
Re: Ds1307 Not moving forward while arduino powered off
Hello Codly,
I don't mind you hijacking it at all. The only thing that pops in my head is that maybe the 1307 is not getting the proper juice at the Vcc pin (being on a socket). Measure it with a mutimeter on that specific pin just to eliminate that possibility.
I don't mind you hijacking it at all. The only thing that pops in my head is that maybe the 1307 is not getting the proper juice at the Vcc pin (being on a socket). Measure it with a mutimeter on that specific pin just to eliminate that possibility.
- stinkbutt
- Posts: 593
- Joined: Wed Feb 17, 2010 2:40 am
Re: Ds1307 Not moving forward while arduino powered off
I've heard that the DS1307 doesn't behave particularly well when it doesn't have a backup battery in the socket. Even when it's being powered by Vcc. You might want to make sure the battery's in there all the time.
-
- Posts: 23
- Joined: Tue Jun 15, 2010 8:36 am
Re: Ds1307 Not moving forward while arduino powered off
Thanks obbi. I plan to hook the RTC up to the 3.3 connection on the arduino, but I will definitely check the output on the analog pin I've been using.
Stink - the battery has been installed except to reset the whole thing and start over as suggested by Lady Ada. and I checked that the battery was putting out 3V.
thanks for the suggestions.
Stink - the battery has been installed except to reset the whole thing and start over as suggested by Lady Ada. and I checked that the battery was putting out 3V.
thanks for the suggestions.
-
- Posts: 23
- Joined: Tue Jun 15, 2010 8:36 am
Re: Ds1307 Not moving forward while arduino powered off
so, I double checked the output of the analog pin (4.4V plenty for this application) and then I removed crystal and hooked in a function generator sqyare wave at 32 kHz (as theoput did here: http://forums.adafruit.com/viewtopic.ph ... 307#p97426) and now it runs fine. I am guessing this is a bad crystal issue.
Thoughts?
Thoughts?
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: Ds1307 Not moving forward while arduino powered off
we're on it, we think its the crystal too
- harryarmst
- Posts: 2
- Joined: Sun Dec 02, 2012 8:03 pm
Re: Ds1307 Not moving forward while arduino powered off
I'm having the same problem with the time not incrementing once set. Am using a nano board and the standard code from the adafruit site. Programming seems to work fine but the time does not change once set. I removed the battery, powered down the nano board to reset everything. Starting again, I set the time once but the clock time doesn't increment. If I wanted to try and find a replacement crystal locally, what type or p/n is it?
Thanks,
Harry
Thanks,
Harry
- NealSnooke
- Posts: 2
- Joined: Sat Oct 24, 2015 7:46 am
Re: Ds1307 Not moving forward while arduino powered off
I solved my version of the problem of the battery backed DS1302 module clock stopping when the system is powered down (assuming you do not have the obvious problems of resetting the time at startup, and the battery is working - in which case you will get the same date with mostly zeros after each power loss). Turns out it was a bit of functionality I wasn't expecting.
the key is on page 7 of the datasheet:
"CLOCK HALT FLAG
Bit 7 of the seconds register is defined as the clock halt (CH) flag. When this bit is set to logic 1, the clock oscillator is stopped and the DS1302 is placed into a low-power standby mode with a current drain of less than 100nA. "
For some reason this flag was being set...
Hope this helps someone - it just cost me 2 hours to figure it out. Please post if it worked for you!
Neal.
the key is on page 7 of the datasheet:
"CLOCK HALT FLAG
Bit 7 of the seconds register is defined as the clock halt (CH) flag. When this bit is set to logic 1, the clock oscillator is stopped and the DS1302 is placed into a low-power standby mode with a current drain of less than 100nA. "
For some reason this flag was being set...
Hope this helps someone - it just cost me 2 hours to figure it out. Please post if it worked for you!
Neal.
- depewke
- Posts: 8
- Joined: Sat Sep 20, 2014 7:48 am
Re: Ds1307 Not moving forward while arduino powered off
Hi Neal,
How did you deal with changing the flag?
How did you deal with changing the flag?
- depewke
- Posts: 8
- Joined: Sat Sep 20, 2014 7:48 am
Re: Ds1307 Not moving forward while arduino powered off
Hi Neal,
How did you deal with changing the flag?
How did you deal with changing the flag?
- NealSnooke
- Posts: 2
- Joined: Sat Oct 24, 2015 7:46 am
Re: Ds1307 Not moving forward while arduino powered off
Hi Harry,
Well the CH bit is the 4th BCD bit of the 10's of seconds counter. So the setDS1302Time(...) function should set it :
but this only happens after you set the clock for the first time. I think I originally was just watching the clock without setting the time (because I didn't care about it) and was surprised that it didn't keep counting when the power was off.
I seem to remember that it was OK after using the above function to set the clock. I guess you would have to write a 1 to rtc.CH to set it back to the factory setting to save the battery if you don't want the clock to keep going.
Neal.
Well the CH bit is the 4th BCD bit of the 10's of seconds counter. So the setDS1302Time(...) function should set it :
Code: Select all
//+++++++++++++++++++ This contains the conversion to BCD, and assigns to the elements ++++++++++++++++++//| |
rtc.Seconds = bin2bcd_l( seconds); //| |
rtc.Seconds10 = bin2bcd_h( seconds); //| |
rtc.CH = 0; // 1 for Clock Halt, 0 to run
I seem to remember that it was OK after using the above function to set the clock. I guess you would have to write a 1 to rtc.CH to set it back to the factory setting to save the battery if you don't want the clock to keep going.
Neal.
Please be positive and constructive with your questions and comments.