I am using a DS1307 twi-connected to an ATMega-16. A Vbat is also connected. I have successfully implemented the date/time setting and reading. After switching off the main supply and switching on again without setting the date/time again the clock is running correctly. I have added code for storing data in the SRAM area and to read back the same. If SRAM data is written and without switching off "mains" the SRAM data which is read back is correct. But if the "mains" is switched off (Vbat is still working) and if we run the code to only read back from the same location, the SRAM data is lost. However the Date/Time data is still correctly read. The Maxim-Dallas DS1307 Datasheet-"I2C Real-Time Clock" clearly states "56-Byte, Battery-Backed, Nonvolatile (NV) RAM for Data Storage". This exercise was only to study a possibility to use the small non-volatile RAM if ever required in future.
If anyone could guide to overcome this strange behaviour, I would be most grateful.