clock module doesnt seem to be working

I am working on keeping time with this rtc module http://www.sparkfun.com/products/99 with a lilypad and this code isnt working for me

I have A4 connected to SCL, A5 to SDL however when i run it it doesnt seem to retrieve any data

i get something like this, "00:00 000"

#include "Wire.h"
#define DS1307_ADDRESS 0x68

void setup(){
  Wire.begin();
  Serial.begin(9600);
  setDateTime(); //MUST CONFIGURE IN FUNCTION
}

void loop(){
  printDate();
  delay(1000);
}

void setDateTime(){

  byte second =      45; //0-59
  byte minute =      40; //0-59
  byte hour =        0; //0-23
  byte weekDay =     2; //1-7
  byte monthDay =    1; //1-31
  byte month =       3; //1-12
  byte year  =       11; //0-99

  Wire.beginTransmission(DS1307_ADDRESS);
  Wire.send(0); //stop Oscillator

  Wire.send(decToBcd(second));
  Wire.send(decToBcd(minute));
  Wire.send(decToBcd(hour));
  Wire.send(decToBcd(weekDay));
  Wire.send(decToBcd(monthDay));
  Wire.send(decToBcd(month));
  Wire.send(decToBcd(year));

  Wire.send(0); //start 

  Wire.endTransmission();

}

byte decToBcd(byte val){
// Convert normal decimal numbers to binary coded decimal
  return ( (val/10*16) + (val%10) );
}

byte bcdToDec(byte val)  {
// Convert binary coded decimal to normal decimal numbers
  return ( (val/16*10) + (val%16) );
}

void printDate(){

  // Reset the register pointer
  Wire.beginTransmission(DS1307_ADDRESS);
  Wire.send(0);
  Wire.endTransmission();

  Wire.requestFrom(DS1307_ADDRESS, 7);

  int second = bcdToDec(Wire.receive());
  int minute = bcdToDec(Wire.receive());
  int hour = bcdToDec(Wire.receive() & 0b111111); //24 hour time
  int weekDay = bcdToDec(Wire.receive()); //0-6 -> sunday - Saturday
  int monthDay = bcdToDec(Wire.receive());
  int month = bcdToDec(Wire.receive());
  int year = bcdToDec(Wire.receive());

  //print the date EG   3/1/11 23:59:59
  Serial.print(month);
  Serial.print("/");
  Serial.print(monthDay);
  Serial.print("/");
  Serial.print(year);
  Serial.print(" ");
  Serial.print(hour);
  Serial.print(":");
  Serial.print(minute);
  Serial.print(":");
  Serial.println(second);

}

Any help would be deeply aprreciated (:

You have your SCL and SDA lines backwards.

Ciao,

have You connected the pullup resistors to the SCL and SDA lines?

Use this sketch to verify if the Arduino arrives to find the RTC.

// Verifica indirizzi e accesso a device I2C
#include <Wire.h>
void setup(void)
{
  Serial.begin(57600);
  Serial.println("Verifica presenza dispositivi I2C");
  Wire.begin();
  delay(5);
  for (uint8_t add = 0X0; add < 0X80; add++) {
    Wire.requestFrom(add, (uint8_t)1);
    if (Wire.available()) {
      Serial.print("Found: ");
      Serial.println(add, HEX);
    }
  }
  Serial.println("Done"); 
  
}

void loop(void){

}

Ciao,
Marco.

Ok let me see if reversing the sda/scl lines fixes the problem

Ciao,

remember to check the pullup resistors.

If You use 5V -> have to be > 1,5 kOhm

For example You can use two 4.7 kOhm or 3.3 kOhm resistors connected one from SCL to +5V and the other from SDA to +5V.

Ciao,
Marco.

Forgotten a link that can be useful... all about DS1307 and Arduino

Ciao,
Marco.