Pesky DS1307 config

Wondering if there is a definitive guide to getting these RTC's working.
I have had a good read through the forums and these have highlighted a few things I have tried, but to no avail.
I have also looked at the playground articles, but again to no avail
Perhaps somebody can help ...please, it's reaaly doing me head in
I have one of the Duemilanove boards
the IC is the maxim DS1307+
I am using a 3v lithium battery as a backup. I have connected the Vbat connector to the +ve connector of the batter, and the -ve to ground. I have the ground on the IC connected to ground on the arduino.
I have the 5v line from the arduino connected to the vcc pin on the IC
i'm connecting pin 4 analog from the arduino to SDA on the IC and ping 5 analog to SCL on the IC.
I am using 1 k ohm resistor as a pull up between the SDA and 5V lines and another one on the SCL pin.

My problem is that I can set the time, it just doesn't tick and advance the time

Is there a routine to check the integrity of the DS1307? I noted on the library for the DS1337 there seems to be a check integrity command is there anything similar for this one?

oh, I also tried taking the battery out of the picture and just grounding the Vbat pin. That didnt get me anywhere either
any help would be most appreciated

Did you clear the "Clock Halt" bit? Page 8 of the DS1307 data sheet says:

Note that the initial power-on state of all registers is not defined. Therefore, it is important to enable the oscillator (CH bit = 0) during initial configuration.

So if you don't set the clock halt bit to 0 the oscillator doesn't tick which leads to the behaviour you are experiencing.

what I do is a :-

if ( rtc_bcd[0] == 0B10000000 )

This means the clock is in the virgin state , battery just been added .
now set the clock eg

etc

rtc_bcd[0]=B00000000; // Second -- 0 --
rtc_bcd[1]=B00000000; // Minites -- 0 --
rtc_bcd[2]=B00010010; // Hours -- 12 --
rtc_bcd[3]=B00000111; // Sunday 1 , Monday 2 , Tuesday 3 etc in BCD -- Saturday -- 7 --
rtc_bcd[4]=B00010111; // Date
rtc_bcd[5]=B00000001; // Month
rtc_bcd[6]=B00001001; // Year

and send then to the clocks command regs.

or just set command reg 0 to 0 / 0 seconds

ah ok, hadnt done that. I guess I had assumed the library would do that as part of its initiation
I'm using this one
http://code.google.com/p/ds1307/downloads/list

So the Ch =0 bit seems to be set in the DS1307 library function
any body got any other ideas?

I guess I had assumed the library would do that as part of its initiation

Well if you'd looked at the code you would see that it doesn't. You need to call the start() method to enable the oscillator after you set the time.

So this is the code
#include <WProgram.h>
#include <Wire.h>
#include <DS1307.h> // written by mattt on the Arduino forum and modified by D. Sjunnesson

void setup()
{
Serial.begin(9600);

RTC.stop();
RTC.set(DS1307_SEC,1); //set the seconds
RTC.set(DS1307_MIN,23); //set the minutes
RTC.set(DS1307_HR,12); //set the hours
RTC.set(DS1307_DOW,4); //set the day of the week
RTC.set(DS1307_DATE,5); //set the date
RTC.set(DS1307_MTH,3); //set the month
RTC.set(DS1307_YR,9); //set the year
RTC.start(); // thought this called the start method

}

It works, well kinda
I changed over my DS1307 for my DS1337. Wired it up as it suggests in the Maxim product info page and tried the same code again
It ticks this time.
although oddly it does seem to like to revisit the same moment in time more than once

15:41:46 7/4/2009
15:41:47 7/4/2009
15:41:47 7/4/2009
15:41:48 7/4/2009
15:41:49 7/4/2009
15:41:50 7/4/2009
15:41:51 7/4/2009
15:41:51 7/4/2009
15:41:52 7/4/2009
15:41:53 7/4/2009
15:41:54 7/4/2009
15:41:55 7/4/2009
15:41:55 7/4/2009
15:41:56 7/4/2009
15:41:57 7/4/2009
15:41:58 7/4/2009
15:41:58 7/4/2009
15:41:59 7/4/2009
15:42:0 7/4/2009
15:42:1 7/4/2009
15:42:2 7/4/2009
15:42:2 7/4/2009
15:42:3 7/4/2009

I'm assuming this isnt working quite right yet?
what could the problem be?

although oddly it does seem to like to revisit the same moment in time more than once

Well time does tend to march on.

What is exactly your expectations here? How often the time is read from the RTC and sent out to the serial monitor is a function of the cycle time of your program, the I2C link speed and the baud rate of the communication channel rather then the RTC module. If you wish each time capture to be unique then you will have to test each recieved and throw away duplicates. Or put a delay of one second in your loop somewhere.

Lefty