Skip to main content
Associate
February 10, 2025
Solved

STM32F103: HSE Crystal Capacitors

  • February 10, 2025
  • 3 replies
  • 3150 views

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

 

Best answer by Peter BENSCH

@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

3 replies

Peter BENSCH
Technical Moderator
February 10, 2025

Welcome @Michael_CH, to the community!

You have provided too little information for a qualified answer. Essentially, however, you will find everything in detail in AN2867.

Hope that helps?

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.
Associate
February 10, 2025

I am not an engineer, but just a hobbyist trying to make my first schematic and a PCB.

I was looking the AN, but honestly that was too complex for me.

 

Therefore i hope some more experienced people can tell me the correct value for the 2 capacitors there. 

 

Which information is missing?

Thank you. 

 

Peter BENSCH
Technical Moderator
February 10, 2025

Firstly, the data sheet of the crystal used is important, from which you can see the key values: C0, CL and ESR.

Furthermore, the AN2867 mentioned above also contains important notes on layout from section 7 onwards, which you should read and try to understand.

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
Technical Moderator
February 12, 2025

@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 "Best answer" on the reply which solved your issue or answered your question.
mƎALLEm
Technical Moderator
April 17, 2025

Hello,

A new article "How to select a compatible crystal and load capacitors for STM32 with layout guidelines" has been published today and this thread has been linked to that article in the "Related links" section.

Good reading.

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