![GigaDevice Semiconductor GD32E23 Series Скачать руководство пользователя страница 203](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32e23-series/gd32e23-series_user-manual_2225794203.webp)
GD32E23x User Manual
203
S1H and A1H can subtract or add 1 hour to the calendar when the calendar is running.S1H
and A1H operation can be tautologically set and DSM bit can be used to recording this
adjustment operation. After setting the S1H/A1H, subtracting/adding 1 hour will perform
when next second comes.
Alarm function operation process
To avoid unexpected alarm assertion and metastable state, alarm function has an operation
flow:
1.
Disable Alarm (by resetting ALRMxEN (x=0) in RTC_CTL)
2.
Set the Alarm registers needed(RTC_ALRMxTD/RTC_ALRMxSS)
3.
Enable Alarm function (by setting ALRMxENin the RTC_CTL)
13.3.6.
Calendar reading
Reading calendar registers under BPSHAD=0
When BPSHAD=0, calendar value is read from shadow registers. For the existence of
synchronization mechanism, a basic request has to meet: the APB1 bus clock frequency
must be equal to or greater than 7 times the RTC clock frequency. APB1 bus clock frequency
lower than RTC clock frequency is not allowed in any case.
When APB1 bus clock frequency is not equal to or greater than 7 times the RTC clock
frequency, the calendar reading flow should be obeyed:
1.
reading calendar time register and date register twice
2.
if the two values are equal, the value can be seen as the correct value
3.
if the two values are not equal, a third reading should performed
4.
the third value can be seen as the correct value
RSYNF is asserted once every 2 RTC clock and at this time point, the shadow registers will
be updated to current time and date.
To ensure consistency of the 3 values (RTC_SS, RTC_TIME, and RTC_DATE), below
consistency mechanism is used in hardware:
1.
reading RTC_SS will lock the updating of RTC_TIME and RTC_DATE
2.
reading RTC_TIME will lock the updating of RTC_DATE
3.
reading RTC_DATE will unlock updating of RTC_TIME and RTC_DATE
If the software wants to read calendar in a short time interval(smaller than 2 RTCCLK
periods), RSYNF must be cleared by software after the first calendar read, and then the
software must wait until RSYNF is set again before next reading.
In below situations, software should wait RSYNF bit asserted before reading calendar
registers (RTC_SS, RTC_TIME, and RTC_DATE):