>so can you explain to me whats exactly the source of this noise!!
The meaning of Life, the Universe and Everything I can probably explain. The source of your noise however escapes me. I'm not in your environment, I can't see your design, and I have no test equipment available to track it down - this is something that you can do - because you are there, and I am here.
I worry about the code that you posted where you say the problem exists. Your While/Wend statements will hang the program until the correct state of the dta pin is recognised. You must track down WHICH of the several WHILE/WENDS is causing your program to hang and then determine WHY dta did not switch as expected. Is it because the PULSEOUT is out of specification and the chip did not acknoledge. Is it because noise on the line is causing the chip to acknowledge at the wrong time or send garbage. You'll have to dig deeper yourself.
It's unusual for the DS1307 to hang... I have tens of thousands in the field and it's never happened. Check your 5v supply is CLEAN. Make sure the Battery isn't next to a contactor switcing kVA - the usual things...
Bookmarks