Show your schematics, pcb and real device photos. There are a lot of errors could be found.
Sorry for the late reply.. i was away for a while.
I have attatched a pcb layout. I hope you can figure out things from the image. Forgive me if their is any mistakes in layout or practical implementation as it is my first project
.
let me brief out things.
This unit consist of PIC18F4520, A DS 1307 connected to it and a RS 232 IC.
Their is another unit placed some distance away which consist of PIC16F628A and rs 232. all the sensor feeds the values to this mcu and it communicates to first unit via UART.
First unit is powered by 12v dc which is fed into 7805 ic, also a 9v rechargeable battery is kept in parallel.
I have noticed that most of the time , the RTC crash occurs when MCU restarts frequently (it happens once in a while ).when it crashes It starts displaying question marks for some values( sometimes its for hours, sometimes minutes,sometimes every values )
Restarting of pic occurs most of the time due to watchdog timeout, and i am yet to find the exact cause. seems like its issue with uart communication.
i would have quoted the program here, but its just too long. And my program writing discipline is very bad, so i am sure most people will find it quite difficult to read it.
B