cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate caps for LSE crystal oscillator

nadeemtamuk191
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions
nadeemtamuk191
Associate III

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

View solution in original post

12 REPLIES 12
AScha.3
Chief II

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 "Accept as Solution".
nadeemtamuk191
Associate III

ok

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

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 "Accept as Solution".
STOne-32
ST Employee

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 

nadeemtamuk191
Associate III

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

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 .

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

can i adjust that some how?

Are there some calibration or tuning values for the LSI ? More coarsely you have to get the appropriate prescaler and divider value in the RTC. The frequency typically isn't 32.768 KHz like the crystal.

fLSI is described in the data sheet typically 32 KHz, but can be 29-34 KHz across temperature and voltage

If LSE isn't starting in the prescribed time you'll need to adjust the capacitors so it starts and is close on frequency.

The values suitable of 6, 9 or 12 pF crystals will be different. And you need to account for the properties of the circuit.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..