system
March 19, 2010, 10:44pm
1
Hi,
I just got a couple of DS1307 Ics from Dallas, and i tried to modify the code from Hobby Robotics » An I2C Bus Example Using the DS1307 Real-Time Clock to get the RTC to output the time.
It looks like i can set the time alright, but the time is not running.
I connected
vcc to +5
gnd to gnd.
scl to scl on the arduino
sda to sda on the arduino
vbat to gnd(just in the test scenario, i dont need to keep time without power connected)
SQW is connected to a 220 ohm resistor and to the positive side of a LED, for debug blinks.
X1 is connected to the one side of a 32Mhz Crystal
X2 is connected to the other side of the crystal
(this type of crystal: http://www.surplectronics.co.uk/prodimages/hc49u.jpg )
What am i forgetting here?
system
March 19, 2010, 11:32pm
2
the DS1307 will not run without the backup battery connected
system
March 20, 2010, 12:00am
3
32Mhz Crystal
You want a 32.768 KHz crystal. Unless this is a typo, you are trying to run it about a thousand times too fast.
the DS1307 will not run without the backup battery connected
Actually, it will as long as Vbat is grounded.
system
March 20, 2010, 10:03am
4
haha, ofcourse its a 32 khz crystal, maybe i was a bit too tired when writing the post.
its a 32.000 khz crystal, which should be ok, right?
but wouldnt it just make the time go fast
system
March 20, 2010, 10:51am
5
scratch that, im pretty sure its a 32 mhz crystal, gonna try to find another.
Thanks for your help!
system
March 20, 2010, 1:18pm
6
system
March 20, 2010, 3:06pm
7
exactly,
Getting one of those on a saturday afternoon isnt easy, guess i need to wait till monday.
you could take apart an old clock and look for one.
system
March 20, 2010, 4:07pm
9
Be careful on the specs for the crystal. That DS1307 and DS1337 require a fairly
low ESR and a particular load capacitor. Double-check the datasheet.
(* jcl *)
www: http://www.wiblocks.com
twitter: http://twitter.com/wiblocks
blog: http://luciani.org
system
March 21, 2010, 7:57pm
10
I think my plan is to buy one of these,
As far as i can read in the datasheet it should work:
I now know why i have been using the dallas ibutton in other projects