404
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
Assume ck_spre frequency is 1Hz, the available wake-up time range from 2s to 18h, and the resolution is
1 second.
When RTC_CTRL.WKUPSEL [2:0] = 10x, the period is range from 2s to 18h.
After RTC_CTRL.WTEN bit is set to 1, the down counter is running and when it reaches 0, RTC_INITSTS.WTF
will be set and the device can exit from low power mode when the periodic wakeup interrupt is enabled by setting
the RTC_CTRL.WTIEN bit.
Periodic wakeup output: periodic wakeup can be mapped to RTC_ALxRM output when RTC_CTRL.OUTSEL[1:0]
is selected, the RTC_OUT pin(PC13) is automatically configured as output, and output polarity can be configured by
RTC_CTRL.OPOL bit.
14.2.13
Wakeup timer configuration
The wakeup timer automatic reload value should be configured in the following below:
Disable wakeup timer by clearing RTC_CTRL.WTEN bit, then wait for RTC_INITSTS.WTWF flag to be set 1.
Select wake up timer clock by set RTC_CTRL.WKUPSEL[2:0] bits.
Configure the wake-up automatic reload value by set RTC_WKUPT.WKUPT[15:0] bits.
Enable Wakeup interrupt by set RTC_CTRL.WTIEN bit(this step can be selected as needed )
Enable wakeup timer by setting RTC_CTRL.WTEN bit
14.2.14
Timestamp function
Timestamp can be enabled by setting RTC_CTRL.TSEN bit to 1. When a timestamp event is detected on the RTC_TS
pin, the calendar values of the event will be stored in the timestamp register (RTC_TSSS, RTC_TST, RTC_TSD),
and RTC_INITSTS.TISF is set to 1. If a new timestamp event is detected when RTC_INITSTS.TISF has been set to
1 already, the hardware sets RTC_INITSTS.TISOVF flag to 1, and the timestamp registers (RTC_TST and RTC_TSD)
will continue to hold the value of the previous event, which means timestamp registers(RTC_TST and RTC_TSD)
data will not change when RTC_INITSTS.TISF=1.
After the timestamp event caused by the synchronization process occurs again, RTC_INITSTS.TISF is set to 1 in 2
RTC_CLK cycles. There is no delay in the generation of RTC_INITSTS.TISOVF. This means that if two timestamp
events are very close, this can cause RTC_INITSTS.TISOVF to be "1" and RTC_INITSTS.TISF to be "0". Therefore,
after detecting that RTC_INITSTS.TISF is "1", then detect RTC_INITSTS.TISOVF bit.
If timestamp events are enabled, the timestamp will capture the calendar read in the timestamp register. Timestamp
events can be generated on any of the 16 GPIO ports selected by EXTI. The GPIO pins in each port are selected by
setting the corresponding EXTI_TS_SEL.TSSEL[3:0] bits.
14.2.15
Daylight saving time configuration
Daylight saving time function can be controlled by RTC_CTRL.SU1H, RTC_CTRL.AD1H, and RTC_CTRL.BAKP
bits. Calendar will subtract one hour when set RTC_CTRL.SU1H bit to 1, and add one hour when set
RTC_CTRL.AD1H to 1. RTC_CTRL.BAKP can be used to remember this adjustment or not.