GD32F403xx User Manual
243
15.
Real-time Clock(RTC)
15.1.
Overview
The RTC is usually used as a clock-calendar. The RTC circuits are located in two power
supply domains. The ones in the Backup Domain consist of a 32-bit up-counter, an alarm, a
prescaler, a divider and the RTC clock configuration register. That means the RTC settings
and time are kept when the device resets or wakes up from Standby mode. While the circuits
in the VDD domain only include the APB interface and a control register. In the following
sections, the details of the RTC function will be described.
15.2.
Characteristics
◼
32-bit programmable counter for counting elapsed time
Programmable prescaler: Max division factor is up to 2
20
◼
Separate clock domains
:
A) PCLK1 clock domain
B) RTC clock domain (this clock must be at least 4 times slower than the PCLK1 clock)
◼
RTC clock source
:
A) HXTAL clock divided by 128
B) LXTAL oscillator clock
C) IRC40K oscillator clock
◼
Maskable interrupt source:
A) Alarm interrupt
B) Second interrupt
C) Overflow interrupt
15.3.
Function overview
The RTC circuits consist of two major units: APB interface located in PCLK1 clock domain
and RTC core located in RTC clock domain.
APB Interface is connected with the APB1 bus. It includes a set of registers, can be accessed
by APB1 bus.
RTC core includes two major blocks. One is the RTC prescaler block, which generates the
RTC time base clock SC_CLK. RTC prescaler block includes a 20-bit programmable divider
(RTC prescaler) which can make SC_CLK is divided from RTC source clock. If second
interrupt is enabled in the RTC_INTEN register, the RTC will generate an interrupt at every
SC_CLK rising edge. Another block is a 32-bit programmable counter, which can be initialized
with the value of current system time. If alarm interrupt is enabled in the RTC_INTEN register,