Go Down

Topic: Coupling caps for this crystal (Read 580 times) previous topic - next topic

liuzengqiang

I thought I knew how to calculate the coupling caps for crystals. It turned out I probably don't. This formula from ATMEGA328 data sheet is for low-frequency only and I use 16MHz. For 16MHz, spec lists 12-22pF as range. I usually use a larger crystal with 12pF load cap but need to go smaller with this one that has 18pF load cap. Should I still use 22pF caps or use this formula that I shouldn't use and go with 28pF?



Low-power oscillator:


Crystal I want to use (18pF load cap) The only one at digikey with 13pF load cap is not in stock.
https://www.digikey.com/product-detail/en/cts-frequency-controls/406C35D16M00000/CTX856CT-ND/2293037
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

CrossRoads

22pF, 50V rating has always worked me with 16 MHz xtals.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

liuzengqiang

CR,

Thanks. Are you using small crystals with 4 pads? IIRC, I asked you for a crystal (might have been a small 4 pad footprint) part number a couple of years ago. I didn't go with it due to its size. I might've lost it. Do you mind sharing the part number again?
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter


liuzengqiang

Thanks Ron. I think the formula in that adafruit blog is essentially the same as the one I posted from atmel, except the stray cap is not doubled in atmel formula. Atmel says that is only needed for low-frequency crystals though. I wonder why they only provide this formula for low-freq.

If I calculate with adafruit formula, assuming a 5pF stray cap, C1,C2=2*18-2*5=26pF.
If I calculate with atmel formula, C1,C2=2*18-5=31pF.
Either way 22pF seems insufficient. I have to have a lot of stray to make that work.
I'm relying on the crystal to do USB full-speed device so I can't be to off. 
If I had CL=12, then C1,C2= 14pF or 19pF. I guess 22pF might be alright when there is less stray.
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

ron_sutherland

The datasheet I have for the 328p has a recommended range of 12-22pf for both low power and the full swing mode (which is no longer supported). I use the low power mode, with 27pF capacitors and take my stray to be about 6pF to match the load capacitance of the crystal.

It is over the suggested range, but the timing seems to be correct. I don't understand how the recommended crystal capacitor range makes sense because it does not account for placing the crystal far from the MCU (e.g., big stray value), I suspect the datasheet range is for the load capacitance of the crystal itself. In my case 20pF = 6.5pF + (27pF*27pF)/(27pF+27pF).

https://www.digikey.com/products/en?keywords=ECS-160-20-3X-TR
my projects: https://github.com/epccs

liuzengqiang

Ron,

See my screen shot in my OP, table 9-3. It is for C1 and C2. I've always used HC49 surface mount crystals with 12pF load cap and 22pF coupling caps with no problem. I'll order a few values to try out with the 18pF 406 footprint crystal. I'll post my results with 22pF. I need to find how to enable clock output on one of the pins so I can measure with my scope.
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

krupski

I thought I knew how to calculate the coupling caps for crystals. It turned out I probably don't. This formula from ATMEGA328 data sheet is for low-frequency only and I use 16MHz. For 16MHz, spec lists 12-22pF as range. I usually use a larger crystal with 12pF load cap but need to go smaller with this one that has 18pF load cap. Should I still use 22pF caps or use this formula that I shouldn't use and go with 28pF?



Low-power oscillator:


Crystal I want to use (18pF load cap) The only one at digikey with 13pF load cap is not in stock.
https://www.digikey.com/product-detail/en/cts-frequency-controls/406C35D16M00000/CTX856CT-ND/2293037


You are worrying about PICO-farads...  the pc board or breadboard has probably 5 to 10 pF or more inherent capacitance between pins anyway.

What am I saying?  Four things:

(1)  Worrying about the difference between 18 and 22 pF is pointless.
(2)  You don't even need them at all (the crystal will be off frequency by a few kHz though...).
(3)  Those two capacitors are LOADING caps, not COUPLING caps.
(4)  You did not mention the approximately 1 megohm required bias resistor across the crystal pins.  You DO need that.

Lastly, a little advice:  Use "full swing" mode for the oscillator.

Have fun!

Gentlemen may prefer Blondes, but Real Men prefer Redheads!

krupski

The datasheet I have for the 328p has a recommended range of 12-22pf for both low power and the full swing mode (which is no longer supported). I use the low power mode, with 27pF capacitors and take my stray to be about 6pF to match the load capacitance of the crystal.
What do you mean full swing mode is "no longer supported"?
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

ron_sutherland

#9
Sep 15, 2019, 11:30 pm Last Edit: Sep 16, 2019, 12:12 am by ron_sutherland
Full swing has been gone for three years



In AT15007 it seems to say the full swing is still in place, but the current datasheet shows it is gone. Should I trust the datasheet or the application note. I can tell you that parts with certification follow the datasheet and the application note is treated as gossip. I am not using the full swing, so it is not my problem.

http://ww1.microchip.com/downloads/en/AppNotes/Atmel-42559-Differences-between-ATmega328P-and-ATmega328PB_ApplicationNote_AT15007.pdf
my projects: https://github.com/epccs

krupski

Full swing has been gone for three years



In AT15007 it seems to say the full swing is still in place, but the current datasheet shows it is gone. Should I trust the datasheet or the application note. I can tell you that parts with certification follow the datasheet and the application note is treated as gossip. I am not using the full swing, so it is not my problem.

http://ww1.microchip.com/downloads/en/AppNotes/Atmel-42559-Differences-between-ATmega328P-and-ATmega328PB_ApplicationNote_AT15007.pdf
Full swing seems to have been removed in the 328pb part, but I disagree with how you said it - you made it seem like full swing is gone everywhere (which, of course, is not true).

I sure hope that the oscillator circuit has been improved because low power mode in the other AVR devices is fragile and susceptible to noise and stray capacitance (like fingers, for example).

Gentlemen may prefer Blondes, but Real Men prefer Redheads!

ron_sutherland

you made it seem like full swing is gone everywhere (which, of course, is not true).
I have been looking at the datasheet, and that is what it has been saying for a long time, the low power mode works fine for my projects (the 328pb and 324pb also work fine and cost less). I did not find the overdriven full swing to be as accurate as the crystal claimed, I found the low power mode operated the crystal within specification as best I could measure it. So I have decided that those claiming full swing was best were doing so for the sake of beginners, it is easy to get somewhat working even if not very accurately.
my projects: https://github.com/epccs

liuzengqiang

I'm using 32u4. Neither 328p nore 32u4 has full-swing option. I disagree with the 1KHz uncertainty. If you read your crystal's datasheet instead of speculating, they usually give you 10ppm, 20pp, 50ppm etc. unless you are using some resonator with 0.1% accuracy. I have a small collection of different cap values to try out, starting with 22pF.
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

liuzengqiang

In case someone else wants some part numbers, my prototype USB feature works with this following parts:
16MHz Crystal:
https://www.digikey.com/product-detail/en/cts-frequency-controls/406C35D16M00000/CTX856CT-ND/2293037

22pF 0603 caps:
https://www.digikey.com/product-detail/en/kemet/C0603C220J5GACTU/399-1053-1-ND/411328

Attached is the device. The QFN package was so hard to place by hand. I got it though.

The crystal is a CTS406 footprint. I think the 0503 are more common so I'm going for those in my next prototype.

Anyone with working 8MHz and 12 MHz 0503 crystal parts and coupling caps? I really appreciate it.
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

DrAzzy

(4)  You did not mention the approximately 1 megohm required bias resistor across the crystal pins. 
Apparently it's usually needed in simulations. In practice, I've never needed one, and I don't recall ever seeing one in a design that I was examining.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Go Up