Hi Weiping,
Thanks for your reply, now the problem is solved, mistake is mine, while i am using EEPROM, the datasheet of eeprom states that we need to give some delay after every write cycle. but the delay i am generating is less when compared to delay given in datasheet later i increased the delay as per requirements and got out of the problem.