GD32F10x User Manual
261
registers
’ value can be set only when the peripheral enter configuration mode. And the CMF
bit in the RTC_CTL register is used to indicate the configuration mode status. The write
operation executes when the peripheral exit configuration mode, and it takes at least three
RTCCLK cycles to complete. The value of the LWOFF bit in the RTC_CTL register set
s to ‘1’,
if the write operation finished. The new write operation should wait for the previous one
finished.
The configuration steps are as follows:
1.
Wait until the value of LWOFF bit in the RTC_CTL register sets to ‘1’;
2.
Enter Configuration mode by setting the CMF bit in the RTC_CTL register;
3.
Write to the RTC registers;
4.
Exit Configuration mode by clearing the CMF bit in the RTC_CTL register;
5.
Wait until the value of LWOFF bit in the RTC_CTL register sets to ‘1’.
14.3.4.
RTC flag assertion
Before the update of the RTC Counter, the RTC second interrupt flag (SCIF) is asserted on
the last RTCCLK cycle.
Before the counter equal to the RTC Alarm value which stored in the Alarm register increases
by one, the RTC Alarm interrupt flag (ALRMIF) is asserted on the last RTCCLK cycle.
Before the counter equals to 0x0, the RTC Overflow interrupt flag (OVIF) is asserted on the
last RTCCLK cycle.
The RTC Alarm write operation and Second interrupt flag must be synchronized by using
either of the following sequences:
–
Use the RTC alarm interrupt and update the RTC Alarm and/or RTC Counter registers
inside the RTC interrupt routine;
–
Update the RTC Alarm and/or the RTC Counter registers after the SCIF bit to be set in
the RTC Control register.
Figure 14-2. RTC second and alarm waveform example (RTC_PSC = 3, RTC_ALRM = 2)
RTC_ Alarm
0
1
2
3
4
RTC_Second
RTC_ CNT
ALRMIF
RTC_ PSC
ALRMIF flag can be cleared by software
RTCCLK
2
3
1
0
3
1
1
3
3
2
1
0
2
0
2
0
2
1
Summary of Contents for GD32F10 Series
Page 63: ...GD32F10x User Manual 63 programmed during the chip production ...
Page 117: ...GD32F10x User Manual 117 010 1 0 011 0 9 ...
Page 416: ...GD32F10x User Manual 416 shadow register updates every update event ...
Page 427: ...GD32F10x User Manual 427 value ...
Page 518: ...GD32F10x User Manual 518 These bits are not used in SPI mode ...