ds1307 Can read time - But its not running

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? :slight_smile:

the DS1307 will not run without the backup battery connected

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.

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

scratch that, im pretty sure its a 32 mhz crystal, gonna try to find another.

Thanks for your help!

You need a 32.768kHz watch crystal.
http://scratchpad.thisandthose.org/scratchpad/article.php?story=20100126164621223

Gordon

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.

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

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 :slight_smile: