AT32F425
Series Reference Manual
2022.03.30
Page 286
Ver 2.01
The ck_a is used for subseond update, while the ck_b is usd for calendar update and periodic
autowakeup. The clock frequencys of ck_a and ck_b can be obtained from thef following equation:
F
ck_a
=
1
DIVA
f
ERTC_CLK
F
ck_b
=
1)
(DIVA
x
1)
(DIVB
f
ERTC_CLK
To obtain ck_b with frequency of 1 Hz, DIVA=127, DIVB=255, and 32.768 kH LEXT should be used. This
ck_b is then used for calendar update.
17.3.2 ERTC initialization
ERTC register write protection
After a power-on reset, all ERTC registers are write protected. Such protection mechanism is not affected
by the system reset. Write access to the ERTC registers (except the ERTC_STS[14: 8], ERTC_TAMP
and ERTC_BPRx registers) can be enabled by unlocking it.
To unlick the write protection of ERTC registers, the steps below should be respected:
1. Enable power interface clock by setting PW CEN=1 in the CRM_APB1EN register
2. Unlock write protection of the battery powered domain by setting BPWEN=1 in the PWC_CTRL
register
3. Write 0xCA and 0x53 to the ERTC_WP register in sequence. Wrting an incorrect key will activate
the write protection again.
Table 17-1 lists the ERTC registers that can be configured only after the write protection is unlocked and
when the initialization mode is entered.
Table 17-1 RTC register map and reset values
Register
ERTC_WP enabled
Whether to enter initilization mode Others
ERTC_TIME
Y
Y
-
ERTC_DATE
Y
Y
-
ERTC_CTRL
Y
Bit 6 and 4 only
-
ERTC_STS
Y, except [14: 8]
-
-
ERTC_DIV
Y
Y
-
ERTC_WAT
Y
N
Configurable
when
WATWF=1
ERTC_ALA
Y
N
Configurable
when
ALAWF =1
ERTC_WP
-
-
-
ERTC_SBS
-
-
-
ERTC_TADJ
Y
N
Configurable
when
TADJF=0
ERTC_TSTM
-
-
-
ERTC_TSDT
-
-
-
ERTC_TSSBS
-
-
-
ERTC_SCAL
Y
N
Configurable
when
CALUPDF=0
ERTC_TAMP
N
N
-
ERTC_ALASBS
Y
N
Configurable
when
ALAWF =1
ERTC_BPRx
N
N
-