In this repo I am trying out STM32's RTC peripheral
- http://embedded-lab.com/blog/stm32s-internal-rtc/ Note: the registers used in this article are not the same as for L4 series.
- Chapter 61: HAL RTC Generic Driver (Page 937 / 2719)
I'll be playing around with Nucleo L412RB-P
- STM32L412RB datasheet
- L4xxx reference manual (Details about RTC registers in chapter 34.6 at page 1047/1999)
RTC time register (RTC_TR
) Keeps track of hours, minutes, and seconds in BCD format.
RTC date register (RTC_DR
) Keeps track of years, week days, months, and date in BCD format.
RTC status register (RTC_SR
)
RTC timestamp time register (RTC_TSTR
)
Note: The content of this register is valid only when TSF is set to 1 in RTC_SR
. It is cleared when TSF bit is reset.
RTC control register (RTC_CR
)
RTC status clear register (RTC_SCR
)
- https://www.youtube.com/watch?v=RDoYo3yOL_E&ab_channel=Computerphile
- https://embedded.fm/blog/2018/6/5/an-introduction-to-bcd
- https://electronics.stackexchange.com/questions/12606/why-do-real-time-clock-chips-use-bcd
HAL_RTC_GetDate()
must be called afterHAL_RTC_GetTime()
in order forsTime
to receive updated values.