MCP79510 RTCC - Date and Time Error - Setting Time at 12h:59sec
How do you get past the time and date errors?
Update RTC registers byte by byte only or you MUST stop the clock before updating RTC registers.
For example, the current time is 11:45 am. Set hours == 12, minutes == 59 and change am to pm. RTC reads back 12:59 am incorrectly. It should read 12:59 pm.
Please read TB3116 and the Errata for more info:
Excerpt from TB3116:
"The oscillator should be stopped by clearing the ST bit in the RTCSEC register if a crystal is used, or by clearing EXTOSC bit in the control register if an external clock source is used; wait for it to stop (the OSCRUN bit in the RTCWKDAT register should change to 0) and then update the register and start the oscillator again."