GD32F20x User Manual
317
with the value of current system time. If alarm interrupt is enabled in the RTC_INTEN register,
the RTC will generate an alarm interrupt when the system time equals to the alarm time
(stored in the RTC_ALRMH/L register),
Figure 17-1. Block diagram of RTC
RTC_DIV
RTC_PSC
RTC_CNT
RTC_ALRM
COMPARE
APB interface
SCIF
SCIE
OVIF
OVIE
ALRMIF
ALRMIE
NVIC
interrupt
controler
APB1 BUS
RTCCLK
Reload
SC_CLK
RTC_Second
RTC_Overflow
RTC_Alarm
Rising edge
EXIT STANDBY MODE
EXTI LINE 17
HXT AL
/
128
LXTAL
IRC40K
RTCSRC[1:0]
BACKUP DOMAIN
PCLK1
RTC Interrupt
17.3.1.
RTC reset
The APB interface and the RTC_INTEN register are reset by system reset. The RTC core
(prescaler, divider, counter and alarm) is reset only by a backup domain reset.
Steps to enable access to the backup registers and the RTC after reset are as follows:
1. Set the PMUEN and BKPIEN bits in the RCU_APB1EN register to enable the power and
backup interface clocks.
2. Enable access to the backup registers and RTC by setting the BKPWEN bit in the
(PMU_CTL).
17.3.2.
RTC reading
The APB interface and RTC core are located in two different power supply domains.
In the RTC core, only counter and divider registers are readable registers. And the values in
the two registers and the RTC flags are internally updated at each rising edge of the RTC
clock, which is resynchronized by the APB1 clock.
When the APB interface is immediately enabled from a disable state, the read operation is
not recommended because the first internal update of the registers has not finished. That
means, when a system reset, power reset, waking up from Standby mode or Deep-sleep
mode occurs, the APB interface was in disabled state, but the RTC core has been kept
running. In these cases, the correct read operation should first clear the RSYNF bit in the
RTC _CTL register and wait for it to be set by hardware. While WFI and WFE have no effects
on the RTC APB interface.
Содержание GD32F20 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F20x ARM Cortex M3 32 bit MCU User Manual Revision 2 2 Oct 2019 ...
Страница 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Страница 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Страница 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Страница 385: ...GD32F20x User Manual 385 ...
Страница 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...