Skip to main content
Associate II
November 7, 2023
Solved

Calculate caps for LSE crystal oscillator

  • November 7, 2023
  • 12 replies
  • 5180 views

hi,

i am using a ECS-.327-9-34QCS-TR with a 1.5pF caps on a STM32H743BIT6.

I want to know the exact method to calculate the right value for the oscillator caps.

because my RTC is off by 5mSec.

This topic has been closed for replies.
Best answer by nadeemtamuk191

i used a 4pf for each load caps to avoid ringing and adjusted in the STM cube to get the proper value

4PF

my oscillator can handle 9PF, so 5pf is the IO cap according to the datasheet in the MCU 

9-5 = 4

12 replies

AScha.3
Super User
November 7, 2023

0,5ms ? in one day - or what?

calulate im ppm deviation, look in ds of the crystal, compare...

the H7 have correction in 0,6ppm steps (afair), but first need exact actual deviation. then set correction factor.

+ the caps - see in ds of crystal, load cap.

If you feel a post has answered your question, please click on " Best Answer ".
Associate II
November 7, 2023

ok

Associate II
November 7, 2023

Sorry scha.3,

my engineers sent me the value

5000 microseconds in 1,000,000 microseconds

how do i set the correction factor?

is in Cube MX?

if i put load caps that is 12.5pF the MCU is not booting properly.

thats the reason i went down to 1.5pF

AScha.3
Super User
November 7, 2023

there is an app.note ...look in stm H743 ..

https://www.st.com/en/microcontrollers-microprocessors/stm32h743vi.html#documentation

but : first set LSE drive level high ! then use cap size, matching the data of your crystal. then check deviation again.

ie.

your crystal has 9pF nominal load. so 12.5pF could be good - but only work with high drive level. try it.

AScha3_0-1699386514097.png

in cube:

AScha3_1-1699387216844.png

 

If you feel a post has answered your question, please click on " Best Answer ".
STOne-32
ST Technical Moderator
November 7, 2023

Dear @nadeemtamuk191 ,

this 32,768KHz is already qualified for our partner ECS to our STM32 series . You need to check  our specific Application Note on how to start 

https://www.st.com/resource/en/application_note/an2867-oscillator-design-guide-for-stm8afals-stm32-mcus-and-mpus-stmicroelectronics.pdf

ad said by @AScha.3  This Crystal is with CL=9pF and good pullability level if you have a good PCB Cs ( parasitic capacitance) should not exceed 3 to 5pF so CL1 and CL2 should be in range of (9-3 ) * 2 =  12pF and (9-5) * 2 = 8pF .  You need also to activate by software the High driver level as by default  after Power up / backup domain - it is set to low drive mode .

 

IMG_5532.jpeg

Hope it helps you .

ciao

STOne-32 

Associate II
November 7, 2023

So I tried on High driver level with caps 12.5pf and it boots and stuck and restarts.

STOne-32
ST Technical Moderator
November 7, 2023

Try to bypass the timeout just for debugging and read back the drive level by software to check the register if really set to high drive mode . If not power off and then On the device .

Associate II
November 7, 2023

so we used the internal to do the RTC, but there is one issue, 25mSec.

can i adjust that some how?

Associate II
November 7, 2023

GOING FROM 1.5PF TO 6PF  did not make much of a difference tbh.

may be there should be done some thing in the cube MX

fyi i did use High driver level

nadeemtamuk191AuthorBest answer
Associate II
November 14, 2023

i used a 4pf for each load caps to avoid ringing and adjusted in the STM cube to get the proper value

4PF

my oscillator can handle 9PF, so 5pf is the IO cap according to the datasheet in the MCU 

9-5 = 4

TDJ
Senior III
November 14, 2023

Just read AN2867 - Oscillator design guide for STM8AF/AL/S, STM32 MCUs and MPUs.
Use only oscillators listed in AN2867, but even then you may experience problems.
External capacitors generally should be 1/2 of the specified crystal capacitance since two capacitors are required.