[riot-notifications] [RIOT-OS/RIOT] cpu: RTC implementation for STM32F1 (#11258)

Kaspar Schleiser notifications at github.com
Tue Apr 9 09:48:47 CEST 2019


kaspar030 commented on this pull request.



> +
+    /* turn on LSE crystal */
+    RCC->BDCR |= RCC_BDCR_LSEON;
+    while ((RCC->BDCR & RCC_BDCR_LSEON) != RCC_BDCR_LSEON) {}
+
+    /* calibration clock from 0 to 0x7F */
+    BKP->RTCCR |= 0;
+
+    /* second interrupt is disabled. */
+    RTC->CRH &= ~RTC_CRH_SECIE;
+
+    _rtc_enter_config_mode();
+
+    /* if the input clock frequency (fRTCCLK) is 32.768 kHz, write 7FFFh in this register to get a signal period of 1 second. */
+    RTC->PRLH = 0;
+    RTC->PRLL = 0x7FFF;

The note is actually taken verbatim from the datasheet.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11258#discussion_r273363739
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190409/33138433/attachment.html>


More information about the notifications mailing list