Sir,
Suppose there is a working pic say 16f877 + lcd 44780 + ds1307.
Apart from accessing various data from rtc the pic is also displaying LCD with some other data.
1. What will happen if I remove the DS1307 ? Will the pic hang/ ignore the rtc chip. and continue to work.
2. If it hangs what is flag that will cause it to, is it SSPIF in PIR1
3. What is first cause to sense there no i2c chip.
what you should do is during chip initialisation code is to check if the chip exists, e.g. with I2C you should get an address timeout error if the addressed chip does not exists, as a further test you could read the current date and time from the RTC. If you failed to find the chip your code would note the fact and not try to talk to it.
However, it is a good idea to have a watchdog timer just in case the system hangs or gets into an endless loop.