Because the system clock may be asynchronous to the RTC_A clock source, special care must be taken when accessing the real-time clock registers.
In calendar mode, the real-time clock registers are updated once per second. To prevent reading any real-time clock register at the time of an update, which could result in an invalid time being read, a keep out the window is provided. The keep out the window is centered approximately -128/32768 s around the update transition. The read-only RTCRDY bit is reset during the keep-out window period and set outside the keep-out window period. Any read of the clock registers, while RTCRDY is reset, is considered to be potentially invalid, and the time read should be ignored.
An easy way to safely read the real-time clock registers is to use the RTCRDYIFG interrupt flag. Setting RTCRDYIE enables the RTCRDYIFG interrupt. Once enabled, an interrupt is generated based on the rising edge of the RTCRDY bit, causing the RTCRDYIFG to be set. At this point, the application has nearly a complete second to safely read any or all of the real-time clock registers. This synchronization process prevents reading the time value during the transition. The RTCRDYIFG flag is reset automatically when the interrupt is serviced or can be reset with software. In counter mode, the RTCRDY bit remains reset. RTCRDYIE is a don't care and RTCRDYIFG remains reset.