![Geehy SEMICONDUCTOR APM32F405 Series User Manual Download Page 275](http://html1.mh-extra.com/html/geehy-semiconductor/apm32f405-series/apm32f405-series_user-manual_573630275.webp)
www.geehy.com Page 274
should be as low as possible. Considering power consumption, RTC internally
adopts dual prescaler, 7-bit asynchronous prescaler APSC and 15-bit
synchronous prescaler SPSC.
RTCCLK first passes through the asynchronous prescaler, and the clock after
frequency division reaches the synchronous prescaler. Two prescalers can be
reasonably configured to generate a 1Hz clock for date.
When the prescaler is used, it is suggested that the asynchronous prescaler
should be adjusted as high as possible to reduce power consumption.
The synchronous prescaled value can also be used as the reload value of the
subsecond counter.
Clock calibration
Clock synchronization
RTC can realize clock synchronization according to external high-precision
clcok and the register RTC_SHIFT. The deviation between RTC clock and
external clock is detected mainly by acquiring the timestamps of subsecond
time period twice. Since the synchronous prescaled value is used as the reload
value of the subsecond counter, and the SFSEC bit of register RTC_SHIFT is
used in the subsecond counter, the SFSEC bit can be adjusted to finely tune the
RTC clock and increase or decrease several cycles artificially.
Reference clock
RTC has internal reference clock detection, which can be used to compensate
the deviation of external LSECLK crystal oscillator. Set RCLKDEN bit to enable
the reference clock detection, compare the external 50Hz or 60Hz reference
clock with the internal 1Hz clock of RTC through RTC_REFIN pin, and through
this mechanism, the 1Hz clock after LSECLK frequency division is automatically
compensated.
After the reference clock detection is enabled, the synchronous and
asynchronous prescaler of the clock unit must be configured as the default
value.
The reference clock detection cannot be used simultaneously with the clock
synchronization, and it should be disabled in standby mode.
RTC coarse digital calibration
RTC_DCAL register can be configured as positive or negative calibration to
update the date in advance or with delay, so the effective frequency can be
adjusted.
RTC precision digital calibration