GD32W51x User Manual
403
2.
Set the Alarm registers needed(RTC_ALRMxTD/RTC_ALRMxSS)
3.
Enable Alarm function (by setting ALRMxEN in the RTC_CTL)
16.3.7.
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 whatever happens.
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):
1.
After a system reset
2.
After an initialization
3.
After shift function
Especially that software must clear RSYNF bit and wait it asserted before reading calendar
register after wakeup from power saving mode.
Reading calendar registers under BPSHAD=1
When BPSHAD=1, RSYNF is cleared and maintains as 0 by hardware so reading calendar
registers does not care about RSYNF bit. Current calendar value is read from real -time
Содержание GD32W515 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32W51x Arm Cortex M33 32 bit MCU User Manual Revision 1 0 Nov 2021 ...
Страница 66: ...GD32W51x User Manual 66 Bits Fields Descriptions 31 0 UNIQUE_ID 95 64 Unique device ID ...
Страница 389: ...GD32W51x User Manual 389 The FWDGT timeout can be more accurate by calibrating the IRC32K ...
Страница 504: ...GD32W51x User Manual 504 ...
Страница 710: ...GD32W51x User Manual 710 ...