
AT32F413
Series Reference Manual
2022.06.27
Page 259
Rev 2.00
Figure 17-1
Simplified RTC block diagram
PCLK1
Powered in
Standby mode
NVIC interrupt controller
Not powered in
Standby mode
1.2V power domain
RTC registers
APB
interface
IE
RTC_DIV
RTC_DIVCNT
Reload
RTC_CNT
=
RTC_TA
TSF
RTC_Second
RTC_Oveflow
RTC_Alarm
TAF
OVFF
VBAT domain
Not powered in
Standby mode
RTC_CLK
LN_CLK
17.4 RTC functional overview
17.4.1 Configuring RTC registers
After a power-on reset, all RTC registers are write protected. Write access to the RTC registers is allowed
only when the write protection is unlocked.
Configuration procedure:
Enable power and battery powered domain interface clock by setting PWCEN =1 and BPREN=1
in the CRM_APB1EN register
Unlock write protection in the battery powered domain by setting BPWEN=1 in the PWC_CTRL
register
Configuring DIV, CNT and ALA registers:
To enable write operation to these registers, the first step is to enter configuration mode (CFGEN = 1).
Setting CFGEN = 0 to exit configuration mode, the values in these registers are actually written to the
battery powered domain, which takes at least three RTCCLK cycles to complete.
Based on synchronization logic, a new value can be written to the RTC registers only when the previous
RTC configuration is completed (CFGF=1).
Configuration procedure:
1.
Wait until the end of register configuration (CFGF=1)
2. Enter configuration mode (CFGEN=1)
3. Configure the corresponding RTC registers
4. Exit configuration mode (CFGEN=0)
5. Wait until the end of register configuration (CFGF=1)
The registers including DIV, ALA, CNT and DIVCNT are reset only by the reset signals in the battery
powered domain. The rest of the registers are asynchronously reset by system reset or power reset.