stm32duino / STM32RTC

Arduino RTC library for STM32.
127 stars 48 forks source link

Using external 32k768 crystal as default clock source instead of the … #8

Closed LieBtrau closed 5 years ago

LieBtrau commented 6 years ago

…inaccurate internal RC oscillator.

Signed-off-by: Christoph Tack prog.send@gmail.com

fpistm commented 6 years ago

Hi @LieBtrau Even if the LSI is inaccurate, it has been chosen because not all boards have an LSE. If your board has an LSE, simply set it before call begin: https://github.com/stm32duino/STM32RTC/blob/1c0c41afb31bf0eb76713171def510d50715e72e/examples/RTCClockSelection/RTCClockSelection.ino#L63

LieBtrau commented 6 years ago

Hi Frederic, I learned the hard way that I first have to select the right clock source.
Yesterday I used the "SimpleRTC" example, where that line is not present. If it had been there, selecting either LSE or LSI, I would have realized much sooner that the wrong clock source was the source of the big time deviation with respect to my PC.

I suggest adding that line to the SimpleRTC example. After all, the examples are there to help people who don't know the innards of the library.

fpistm commented 6 years ago

I understand. Example could be updated to add this behaviour.