C1 - C2 = 2*CL – 2*Cstray
So, the CL value is the value in the capacitor datasheet. The Cstray is the capacitance of the PCB. I'm not sure how to determine this value, but as the article suggests, I've used a value of 5 pF.
So, the CL value is the value in the capacitor datasheet. The Cstray is the capacitance of the PCB. I'm not sure how to determine this value, but as the article suggests, I've used a value of 5 pF.You should look into datasheet. When you have 7pF crystal and just assume out of your head that chip itself provides 5pf of load capacitance (which is already most of load capacitance you need), you can easily be 2 times off when selecting capacitors.
There may also be a difference in the max drive current of the oscillators between the two MCUs.
Another thing I've noticed, my 15 pF cap is a X7R part, while the 4 pF part is a C0G part. What is the correct type of cap for a crystal? C0G should be the correct type, right?
Another thing I've noticed, my 15 pF cap is a X7R part, while the 4 pF part is a C0G part. What is the correct type of cap for a crystal? C0G should be the correct type, right?I wonder why X7R do even exist in such small capacitance. You shouldn't use them, C0G is the way to go. X7R are highly unstable.
I've got a value of 1.4 µA of LSE driving current for the STM part. The GigaDevice part mentions a "LXTAL oscillator operating current" of 6 µA. Are they referring to the same thing, looking at how far the values are apart? If they do, the GigaDevice part has a much higer value. It sounds to me like the current used when the oscillator is active, internally and externally.
Another thing I've noticed, my 15 pF cap is a X7R part, while the 4 pF part is a C0G part. What is the correct type of cap for a crystal? C0G should be the correct type, right?
Now, let's say, I have a crystal 8 MHz, 20 pF. This would give me (2*20)-(2*5)= 30 pF. And for the 32 kHz crystal, I've got 7 pF. (2*7) - (2*5) = 4 pF. Now, when I build a board with these components, and I use a STM32F103C8T6 microcontroller, the low frequency clock starts fine. However, when I use a GD32F103C8T6, the low frequency clock doesn't start. When I replace the caps with 15 pF caps, the low frequency clock does start.
I didn't see this application note mentioned:
https://www.st.com/content/ccc/resource/technical/document/application_note/c6/eb/5e/11/e3/69/43/eb/CD00221665.pdf/files/CD00221665.pdf/jcr:content/translations/en.CD00221665.pdf
The whole thing is relevant, the most salient part starts at page 21.
Even shorter synopsis: Is this a low-power or space constrained design? If not, then a larger, lower ESR crystal and the appropriate larger capacitors will be the most stable and durable solution.
I must admit I don't understand all of what is in that document. I've looked at the figure on page 20, where 7 pF intersects the low power and low drift. That's how I've decided to select 7 pF.
This is a research project, to see what's involved in making my own PCBs. One of the things I'm thinking about is running a comparison between some clones.
Another thing I wish to investigate is connecting the VBAT to a coin cell battery, to keep the time when the board is not powered. In this case I would care about the power consumption.