I have a question. I recently ordered my first fully SMT assembled PCB carrying an atmega328p. It is yet to be produced by JLCPCB. The board contains this crystal. I found online to use 2x 12pF capacitors instead of 22pF.
My board has a icsp connector for programming, but in retrosight... a USB socket... or having atleast the RX TX breakout.... it would have been really smart... I have little ways of talking to the board now. I can communicate though... I can change the arduino nano of my DIY ICSP programmer (with ISPprogrammer SW) by an other nano which can talk via software serial over the ICSP pins. Creative solution..
Anyways. I am adding a schematic for a ch340 to my own personal schematic database. And I found a similar crystal on JLCPCB's basic part list with the same name only rated for 12Mhz. And I believe the Ch340 uses 12MHz not?
However I do not really know which capacitor values I should use for this one. I recall that the frequency for the ch340 has to quite accurate/stable.
It has been a while since I have designed crystal osciallator circuits, but from memory the load capacitance is the capacitance of interest. The two capacitors fitted to the circuit are effectivly in series, as seem by the crystal. 2 x 12pF would be 6pF when in series and 2 x22pF would be 11pF.
I agree that the section of data sheet is unclear.
IIRC the crystal data should specify the nominal parallel capacitance for the nominal frequency. Each of your caps should be twice that value since the crystal sees them in series.
The datasheet they link to gives options for the cap which they could order to, but it looks like they decided on 20pF. Absent anything else, that would imply 2x39pF in series to me for the oscillator.
I had a client that had thousands (out of hundreds of thousands) of embedded systems that failed to operate reliably, often at temperatures that were not in the lab or manufacturing plant. Someone had attempted to save cost by fitting cheaper Xtals.
I did an exercise (plus some investigations with support from Xtal suppliers) to test for oscillator robustness. IIRC I devised a simple test to add a small values series resistor, temporarily in series with the Xtals in question. If the oscillator oscillated with the external resistor comparable to the Xtal's series resistance, then the design was robust. The series resistor was not fitted in the delivered items. The series resistor gave an indication of the margin.
As far as I know this solved the immediate issue and was rolled out across the all new designs.
This indicates that there are risks, even professional design teams can have difficulties. At least you will be able to change capacitors if you have difficulties as part of your debugging process.
A quote form one of the links in the above page; " Equivalent Series Resistance (ESR)
The equivalent series resistance (ESR) is an electrical representation of the mechanical losses and at the series resonant frequency, fs, it is equal to R1 in the electrical model. The ESR is a very important parameter and can be found in the crystal data sheet. The ESR will usually be dependent on the crystal’s physical size and small crystals (especially small SMD crystals) typically have higher losses and ESR values than larger crystals.
Higher ESR values will load the inverting amplifier more and too high ESR may cause unstable oscillator operation. Unity gain will not be achieved and the Barkhausen criterion will not be fulfilled."
Yes, but not so much that the small variation introduced by the load capacitors makes any significant difference. It's only to control the baud rate, and a quartz crystal in any working configuration greatly exceeds the required timing accuracy.
There are some good oscillator design application notes lurking around the net, from the manufacturers. Have a look. They supply the missing context on a lot of crystal data sheets.
This is the only 12MHz crystal that was in the basic part list, hence it was me first choise Non basic parts are not that much a problem for larger orders. It only costs 3$ extra per order.
Based upon what I read here. The datasheet is too vague. I think it may be a good practice to make a separate ch340 converter using the smt assembly service and 20pF capacitors and see if that works. If not I can atleast swap out the capacitors. I also have a buck converter circuit I wanna test out as well.
If I cannot get the crystal to work at all I should either migrate to a different crystal or simply stick to external usb-ttl converters
The crystals using 2 caps, 1 at each terminal to ground, are for parallel resonant crystals that are frequency calibrated for a certain load capacitance. The data sheet should specify the load capacitance for the marked frequency. The designer should provide the 2 caps such that their total series connected value matches the load capacity. Note that the caps do not have to be equal in value. In fact many critical crystal oscillator circuits use unequal values and one of them being variable so the actual frequency of oscillation can be tuned to what is required.
Just to avoid another source of potential confusion, all crystals have both a parallel and a series resonant frequency which are very close together, the parallel resonant frequency being higher. The usual gate oscillator circuit on processors excites the parallel resonance. You can't purchase a "parallel resonant crystal" as such, just one with a specific parallel resonant frequency with a certain parallel capacitor.
That is correct. When the crystal is manufactured, it is ground for a particular frequency in series or parallel mode. The parallel mode crystal is most frequency accurate with the same load capacitance as the manufacturer used for grinding it.
I would bet good money that of the millions of ch340-based USB/Serial "Things" out there, the number of designs that have paid careful attention to the load capacitors on the crystal are ... very rare.
(AFAIK, the CH340 needs the crystal both for USB synchronization AND baud rate generation. The former is likely to be more picky about accuracy.)
(There are newer (?) versions of the CH340 series that do not need an external crystal. I'm a big fan of CH340E modules )