cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103: HSE Crystal Capacitors

Michael_CH
Associate II

Hello

 

Which are the correct Capacitors to use for HSE on STM32F103 with the following Crystal?

Frequency: 8 MHz

Load capacitance CL: 20 pF

 

Thank you in advance for a quick hint.

Regards

Michael

 

21 REPLIES 21

Hi,

so take 20pF (or 16...22pF) - and it will work.

standard circuit:

AScha3_0-1739368544034.png

In cpu F103 is everything, just connect the crystal + 2x 22pF .

If you feel a post has answered your question, please click "Accept as Solution".

@Michael_CH 

I have just taken the parameters of your crystal and calculated them according to the AN2867: with a gain margin of 58.451 you are considerably above the minimum of 5, so you can continue working with this crystal.

If you assume a pin capacitance of 4pF, your load capacitors should therefore be larger than 20pF and be around 32pF (2x32pF in parallel series + 4pF pin capacitance = 20pF).

However, the layout is just as important as the capacitors, as I mentioned in a previous post.

Good luck!
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
mƎALLEm
ST Employee

@Michael_CH ,

Let's do a calculation based on what AN2867 says.

The rule is to have gain margin > 5 (a condition that lets the oscillation to start).

Where:

SofLit_0-1739370602336.png

gm is given by product in the table 6 in the application note:

SofLit_1-1739370656521.png

gm crit formula is provided in the 3.4 Oscillator transconductance section:

SofLit_2-1739370714385.png

In your case: 

CL= 20 pF, C0 = 3 pF, ESR = 80Ω 

-> gmcrit = 4 x 80 x ( 2 x pi x 8.10 6)² x (3.10-12 + 20.10-12)²  = 0,42 mA/V

An example of calculation has been provided in the same application note:

SofLit_3-1739370809772.png

So in your case gain margin = 25 / 0,42 = 59 > 5

Normally it should work.

Hope that answers your question.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

@Peter BENSCH 

I have to choose 30pF or 33pF.

I will select 33pF then for the 2 C, as it is more near your value.

Thank you very much!

 

About the layout: It sure not will be ideally, as my PCB will be 2 layers only.

I for sure try to put the crystal and the 2 Capacitors as close as possible to the OSC pins.

 

@mƎALLEm  thanks for confirming that my crystal should work.

 

 

As your question has been answered please Accept as solution the comment that answered your question (Not this comment).

Thanks.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello @Peter BENSCH,

Why did you assume a total stray capacitance of 4pF? Most of the STM32 datasheets say that the pin capacitance is 5pF per pin (10pF total for both pins). If we assumed 10pF stray capacitance, we would need a crystal with a load capacitance greater than that, yet all the recommendations in AN2867 are CL of 8pF or less.

Even the STM32H753 datasheet says to use 10pF stray capacitance in this blurb on page 232:

NAbun1_0-1740715635353.png

 

Are the datasheets wrong, or do most people just not care that much about frequency accuracy?

@NAbun.1 

The stray capacitance depends on several parameters: package variant, type of board, layout, etc. I had only assumed the approximate value and was a little too low with 4pF. So if you assume CS=10pF, CL1 and CL2 should indeed have the 20pF already mentioned.

As far as the AN2867 is concerned, please note the MCU families for which the CL of 8pF is specified - you have probably looked up:

  • in table 7, which applies to LSE of the STM32
  • in section 6, which applies to the STM8

In addition, these values refer to the CL of the respective crystals, i.e. the series connection of both load capacitors + stray capacitance.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

@Peter BENSCH 


So I should better use 20pF instead of the 33pF (derivated from your first suggested 32pF) ?

 

STM32F103 Package variant which i will use is LQFP-48_7x7

 

 

Yes, for your 2-layer design you can use 20...22pF ceramic caps as already suggested by @AScha.3. However, it should also work with 32pF, except that the frequency is pulled a little more.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi @Peter BENSCH 

Thanks for your quick response. I now see that AN2867 does not actually recommend any HSE oscillators for STM32s as you have pointed out. So it is recommended to assume 5pF pin capacitance for STM32s given that is all the information we have? Or is there another document with recommended HSE crystals for STM32s?

I looked at the STM32H753 eval boards. The nucleo has an oscillator instead of a crystal. However, the STM32H753I-EVAL board has this part number: NX3225HA-25MHz-EXS00A-CH00343

It appears to be obsolete and I can't find any information on it. Do you have any more information on that part number?

Lastly, I did find this post that discusses that the actual capacitance on the STM32 LSE pins was measured by this guy to be much less: https://community.st.com/t5/stm32-mcus-products/crystals-and-load-capacitors-for-stm32l432/m-p/344470. I know package matters as you have said, but I'm struggling to determine how to best approach the problem given I need high accuracy and have a limited area to work with (smaller crystals that meet the AN2867 requirements have <= 10pF load capacitance).