Real-Time Clock
7-172
The RTC_DISABLE bit of the CTRL register must only be used to completely
disable the RTC function. When this bit is set, the 32-kHz clock is gated, and
the RTC is frozen. From this point, resetting this bit to zero can lead to unex-
pected behavior. To save power, this bit must only be used if the RTC function
is not wanted in the application.
7.13.2.3
Compensation Registers
Access to the COMP_MSB_REG and COMP_LSB_REG registers must
respect the available access period. These registers must not be updated
during compensation (first second of each hour), but it is acceptable to update
them during the second preceding a compensation event (see Figure 7–61).
For example, the MPU can load the compensation value into these registers
after each hour event during an available access period.
7.13.2.4
Modify Time and Calendar Registers
To modify the current time, the MPU writes the new time into time and calendar
registers to fix the time and calendar information. The MPU can write into time
and calendar registers without stopping the RTC; but in this case, the MPU
must read the status register to ensure that the RTC updating takes place in
more than 15
µ
s (bit BUSY should be 0). Then the MPU must perform all
changes in less than 15
µ
s to prevent partial updating between the beginning
and the end of the writing sequence into time and calendar registers.
Also, the MPU can stop the RTC by clearing STOP_RTC bit of the control reg-
ister (owing to internal resynchronization, the RUN bit of the status must be
checked to ensure that the RTC is frozen), update time and calendar values,
and restart the RTC by resetting the STOP_RTC bit.
7.13.2.5
Rounding Seconds
Time can be rounded to the closest minute, by setting ROUND_30S bit of the
control register. When this bit is set, time and calendar values are set to the
closest minute value at the next second. ROUND_30S bit is automatically
cleared when rounding time is performed.
Example:
-
If current time is 10H59M45S, round operation changes time to
11H00M00S.
-
If current time is 10H59M29S, round operation changes time to
10H59M00S.