Page 1 of 1

STM32F103C8 and bad LSE clock

Posted: Sun Sep 29, 2024 9:17 am
by ChPr
Hello everybody,

I'm using an STM32F103C8 board on a PCB. All the pins on the STM32F103C8 are soldered to the PCB, including PC14 and PC15.

The frequency from the LSE clock is such that it loses about 2 minutes per day, which is enormous. Do you think this is due to the parasitic capacitances added by the PCB, or is it another reason ?

Best regards.

Pierre.

Re: STM32F103C8 and bad LSE clock

Posted: Sun Sep 29, 2024 9:55 pm
by STM32ardui
A crystal with 20 ppm should have a deviation of 1,7 s per day. May be more, if board is not working at room temperature.
You are not the first here with LSE problems on a STM32F103 ...

1. Sure you activated LSE?
2. May be crystal is damaged?
3. Stray capacity can have an effect. I would guess, the short lines to pinheader and pins have something below 5 ~ 8 pF.
4. You can cut lines to pinheader and observe, if it's getting better.
5. Or you can take another board to compare.

AN2867 Guidelines for oscillator design

Re: STM32F103C8 and bad LSE clock

Posted: Mon Sep 30, 2024 1:38 am
by ag123
there are some codes for adjusting LSE for RTC on stm32f103 in libmaple core
https://github.com/rogerclarkmelbourne/ ... /RTCAdjust
but that you would need to port that code over to stm core if you want to use it

i used it to adjust cheap Alix crystals that are sometimes wildly off
https://www.aliexpress.com/w/wholesale-32768.html

alternatively, get a better crystal

Re: STM32F103C8 and bad LSE clock

Posted: Tue Oct 01, 2024 7:44 am
by ChPr
Hello everybody

The last measurement I took showed a loss of 3 minutes over one day.

Not knowing if I was going to succeed, I set about desoldering pins PC14 and PC15 between the STM32 board and the PCB. Not easy, but I succeeded.

But what a satisfaction ! Since yesterday, my LSE clock has lost only one second.

Best regards.

Pierre.

Re: STM32F103C8 and bad LSE clock

Posted: Mon Oct 14, 2024 8:12 am
by defensemanage
ag123 wrote: Mon Sep 30, 2024 1:38 am there are some codes for adjusting LSE for RTC on stm32f103 in libmaple core
https://github.com/rogerclarkmelbourne/ ... /RTCAdjust
but that you would need to port that code over to stm core if you want to use it

i used it to adjust cheap Alix crystals that are sometimes wildly off
https://www.aliexpress.com/w/wholesale-32768.html

alternatively, get a better crystal
Easy to find information on github page through keywords. The sources you update are really great!