Author Topic: Optimizing crystal load capacitance  (Read 7642 times)

0 Members and 4 Guests are viewing this topic.

Offline okwTopic starter

  • Frequent Contributor
  • **
  • Posts: 459
  • Country: no
Re: Optimizing crystal load capacitance
« Reply #25 on: November 19, 2024, 01:36:00 am »
What do those dBm numbers even mean?
Aren't you after frequency error?

As for the drive power from the signal generator to the MCU, the MCU datasheet should have details on the requirements for external clocks.
For example, if used with an external TCXO.

Yes, frequency is of concern. But with no/low drive level on the crystal, I have no frequency.
I mean if the levels would indicate that the level should be higher, especially on the boards with a smaller capacitor?

I'm not hugely surprised that the oscillations are weak or nonexistent with 330pF, that's likely 10x to 20x too large of a cap.

Usually the Pierce oscillator in MCU's is rather tolerant of wrong loading caps, but the 40MHz crystal is likely an overtone one and thus the caps and series inductor matter more.

In any case, the capacitors look way too large and contribute to general weirdness.
If the setup is marginal just probing it with an oscilloscope probe might kill the oscillation or detune the oscillator.
Some simple receive loop/probe for the magnetic field connected to the TinySA is what I'd do to verify that it is oscillating and doing it on the right frequency.

I don't think it's oscillating at all, since uploading code fails (through an external CH340, not the native USB).
 

Offline bson

  • Supporter
  • ****
  • Posts: 2829
  • Country: us
Re: Optimizing crystal load capacitance
« Reply #26 on: November 19, 2024, 08:42:37 pm »
How about selecting a crystal that has better information than:
"8, 16, 20 pF or specify"
Duh.

It's a 9pF ±10ppm.
I have a very simple XO load capacitor calculator at https://github.com/bson/xoload
It's created for the typical, common case where the load is symmetric.  The calculation is trivial, I just got tired of looking it up every time.

Using CL=9.5, Cpin=2 (you should use the actual value from the datasheet), I get 17pF load caps.
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3438
  • Country: au
Re: Optimizing crystal load capacitance
« Reply #27 on: November 19, 2024, 09:22:33 pm »
40MHz Surface Mount Crystal 9pF ±10ppm ±15ppm SMD2016-4P Crystals ROHS
https://www.lcsc.com/product-detail/Crystals_YL-Failong-Crystal-9S40000048_C516561.html

The vendors website does not mention a 48 suffix in their 40MHz offerings that I could find  ?

http://dgylec.com/product-list/cat_id/2893/name/9S+Series+%282016%29.html

Do you have another MCU that can oscillate at 40MHz (or even a 74LVC1GU04 / 74LVC2GU04 ) that can check the crystal is legit ?
How certain are you of your measuring setup ?

This is a typical crystal pull range = +/- 20ppm is easy, but 140ppm is getting extreme.

 

Offline Bud

  • Super Contributor
  • ***
  • Posts: 7965
  • Country: ca
Re: Optimizing crystal load capacitance
« Reply #28 on: November 19, 2024, 11:08:02 pm »
To calculate the two capacitors value you have to consider 3 components: ESP32 pin capacitance,  PCB stray capacitance, and the combined value of the  two physical capacitors. Assume PCB stray capacitance ballpark of 2pF,. 2 ESP32 pins 2pF each, in equivalent schematic connected in series, so they produce 1pF. Connected in parallel with stray capacitance totalling to 3pF. If the desired load capacitance should be 9pF, that leaves 9-3=6pF for the series combined physical capacitors (in equivalent schematic they are connected in series). Two 12pF physical capacitors will give 6pF in series. Therefore you start with 12pF capacitors from each leg of the crystal to ground, to arrive to 9pF load capacitance.
Facebook-free life and Rigol-free shack.
 

Offline okwTopic starter

  • Frequent Contributor
  • **
  • Posts: 459
  • Country: no
Re: Optimizing crystal load capacitance
« Reply #29 on: November 20, 2024, 12:48:29 am »
40MHz Surface Mount Crystal 9pF ±10ppm ±15ppm SMD2016-4P Crystals ROHS
https://www.lcsc.com/product-detail/Crystals_YL-Failong-Crystal-9S40000048_C516561.html

The vendors website does not mention a 48 suffix in their 40MHz offerings that I could find  ?

Yes, they have over 600 crystals :) So I had to filter for 40MHz. Here is the product page:
http://dgylec.com/detail/42769_9S40000048.html
And datasheet:
http://dgylec.com/uploads/files/products/product-file-170548627726.pdf


40MHz Surface Mount Crystal 9pF ±10ppm ±15ppm SMD2016-4P Crystals ROHS
https://www.lcsc.com/product-detail/Crystals_YL-Failong-Crystal-9S40000048_C516561.html
Do you have another MCU that can oscillate at 40MHz (or even a 74LVC1GU04 / 74LVC2GU04 ) that can check the crystal is legit ?
How certain are you of your measuring setup ?

I'm quite certain the equipment is ok. I have two TinySA Ultra and two R&S SME03. I set the SME03 to 2.45GHz and observed +3ppm on one TinySA and 8ppm on the other. Tried then with the other SME03 and they were 2ppm and 7ppm off. So I would assume they are dead on.
When I measure the crystals I use a 10x probe with the little ground spring (not the clip), and 10dB and 20dB attenuator +a DC block. Probably overkill with 30dB...

I could probably desolder the crystal and load caps and inject a 40MHz. Design guide recommends amplitude of minimum 500mV. Would that be approx. +4dBm?
Do I put a DC block in or doesn't it matter to the ESP32?
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3438
  • Country: au
Re: Optimizing crystal load capacitance
« Reply #30 on: November 20, 2024, 01:17:37 am »
Do I put a DC block in or doesn't it matter to the ESP32?
A coupling cap would allow the crystal amplifier to bias correctly.

I also found this, which is an interesting crystal or crystal+osc simulator. They suggest slightly skewed Cg.Cd values.

https://www.geyer-electronic.de/en/design-test-center/design-support/#y-design-app2
 

Offline okwTopic starter

  • Frequent Contributor
  • **
  • Posts: 459
  • Country: no
Re: Optimizing crystal load capacitance
« Reply #31 on: November 20, 2024, 09:19:54 pm »
Do I put a DC block in or doesn't it matter to the ESP32?
A coupling cap would allow the crystal amplifier to bias correctly.

I also found this, which is an interesting crystal or crystal+osc simulator. They suggest slightly skewed Cg.Cd values.

https://www.geyer-electronic.de/en/design-test-center/design-support/#y-design-app2

Cool. I tried to run it, but Windows 7 complained about some missing libraries :(

Could a feedback resistor across the crystal help?
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3438
  • Country: au
Re: Optimizing crystal load capacitance
« Reply #32 on: November 20, 2024, 10:46:41 pm »
Could a feedback resistor across the crystal help?
Not usually, that just dampens things, it is not going to shift the frequency.
I'd try another crystal - if you can extract a part code from a vendors eval board, that's a good place to start.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->