STM32F103C8 and LSE clock

Post here first, or if you can't find a relevant section!
Post Reply
ChPr
Posts: 25
Joined: Thu Jun 20, 2024 8:03 am
Answers: 1

STM32F103C8 and LSE clock

Post by ChPr »

Hello everyone,

To have an accurate clock with the STM32F103C8, I use the LSE mode.

Before doing so, I used LSI mode and I noticed a significant drift with my PC clock, for example.

I switched to LSE mode and ran my tests again: I didn't notice any improvement.

I read somewhere that, to activate this mode, you had to press the reset button on the STM32F103C8 after downloading the program.

I then noticed that the STM32F103C8's clock followed my PC's clock to within a second or two over the course of a day.

I can't seem to find this fact of pressing the reset button to activate the LSE clock.

So:

* I was dreaming,
* it's a coincidence,
* is it real?

Best regards.

Pierre.
ChPr
Posts: 25
Joined: Thu Jun 20, 2024 8:03 am
Answers: 1

Re: STM32F103C8 and LSE clock

Post by ChPr »

I went back to LSI mode (without pressing the “reset” button) where I noticed a huge discrepancy between this clock and my PC's clock.

I then switched back to LSE mode (still without pressing the “reset” button) and my STM32 clock wisely came back to follow my PC's clock.

Well, I must have been dreaming about pressing the “reset” button to validate the change of clock mode.

Sorry.

Best regards.

Pierre.
ag123
Posts: 1898
Joined: Thu Dec 19, 2019 5:30 am
Answers: 30

Re: STM32F103C8 and LSE clock

Post by ag123 »

the theory goes that if you have a *good* 32k *crystal* (e.g. those "epson" ones, at least that quality) gold leaf plated electrodes quartz crystal machined for extreme accuracy and low variance to temperature, then that in theory you have an 'atomic clock' in a crystal, 'immune' to temperature changes.
this level of perfection is ordinarily not possible
and "cheap aliexpress crystals"
https://www.aliexpress.com/w/wholesale-32768.html
10 - 50 pieces for a dollar
you tend to get one that *drifts*, and the *drifts* tend to be constant, i.e. you can 'correct' that drift with some 'simple' adjustments.
The common assumption is that crystals are less susceptible to temperature changes vs rc oscillators.
but for *cheap* crystals, they may not be *real* crystals after all, I'd not be surprised it may be PZT or something.
https://en.wikipedia.org/wiki/Lead_zirconate_titanate

'legendary epson crystals' are like these
https://www.youtube.com/watch?v=7HknJK-jez0
https://www.epsondevice.com/crystal/en/ ... scillator/
Post Reply

Return to “General discussion”