I am trying to use a edited version of the library given at this link
Yet-Another DS1337 RTC library - Development - Arduino Forum. I am able to use this library after some editing. Though i am not a hard core programming guy , but somehow i am always able to use some existing library. I made a sample code, just to write time to DS1337 and read from it. Below is the code
#include <DS1337.h>
#include <Wire.h>
#include <avr/power.h>
#include <avr/sleep.h>
int i;
DS1337 RTC = DS1337();
void setup(){
Serial.begin(9600);
if(!RTC.time_is_set())
{
Serial.println("Clock did not set, wtf? Check that its oscillator is working.");
}
RTC.start();
RTC.setSeconds(00);
RTC.setMinutes(00);
RTC.setHours(05);
RTC.setDays(06);
RTC.setMonths(3);
RTC.setYears(2014);
RTC.writeTime();
}
void loop(){
int i;
for(i=0;i<=5;i++){
RTC.readTime(); // update RTC library's buffers from chip
printTime(0);
delay(5000);
Serial.print("\n");
}
}
void printTime(byte type)
{
// Print a formatted string of the current date and time.
// If 'type' is non-zero, print as an alarm value (seconds thru DOW/month only)
// This function assumes the desired time values are already present in the RTC library buffer (e.g. readTime() has been called recently)
if(!type)
{
Serial.print(int(RTC.getMonths()));
Serial.print("/");
Serial.print(int(RTC.getDays()));
Serial.print("/");
Serial.print(RTC.getYears());
}
else
{
//if(RTC.getDays() == 0) // Day-Of-Week repeating alarm will have DayOfWeek *instead* of date, so print that.
{
Serial.print(int(RTC.getDayOfWeek()));
Serial.print("th day of week, ");
}
//else
{
Serial.print(int(RTC.getDays()));
Serial.print("th day of month, ");
}
}
Serial.print(" ");
Serial.print(int(RTC.getHours()));
Serial.print(":");
Serial.print(int(RTC.getMinutes()));
Serial.print(":");
Serial.print(int(RTC.getSeconds()));
}
This code however give this output.Have a look at the enclosed image i.e DS1337 output.jpg
Now with this it is quite clear that my oscillator is not working, although i am able to set the date and time(but that time is not increasing ).Here is the wiring scheme which i used i.e. DS1337 wiring
I am unable to get what wrong i am doing. At present i am not using the alarm capabilities of the DS1337 , basically for which DS1337 is used.
Need help with this.

