Hello Latha,
I had the same problem in past, I solved in this manner:
-) when the power supply switch off i have a battery that mantains the power only on the 3V3 (52235 and some buffers...);
-) the controller goes in the low power mode (where the RTC runs);
-) to exit from low power mode I use the interrupt of EPORT with the normal power supply; in the interrupt routine the Software copies the values of RTC registers in RAM:
backup_HHMMSS = (MCF_RTC_HOURMIN << 16) + (MCF_RTC_SECONDS);
backup_day = MCF_RTC_DAYS;
-) in the initial routines, before the RAM inizialization, the software restore the values from RAM to RTC registers:
MCF_RTC_HOURMIN = ((backup_HHMMSS >> 16) & 0x1F3F);
MCF_RTC_DAYS = (backup_day & 0x0000FFFF);
MCF_RTC_SECONDS = (backup_HHMMSS & 0x003F);
BR,
Paolo