Author Topic: Can a clock be used to replace a crystal oscillator in most/all scenarios?  (Read 1633 times)

0 Members and 1 Guest are viewing this topic.

Offline frasdogeTopic starter

  • Contributor
  • Posts: 19
  • Country: au
Hi,

So I'm looking at using a micro (ATMega32U4 or STM32G031) for a project, as well as one or more FDC2214 capacitance to digital converters. All of these ICs have the option to use an external oscillator to improve accuracy.


I've not used a crystal oscillator before and so I had a google. Some alternatives came up like clock source ICs and MEMS. They seem to claim a lot of benefits, such as being able to drive multiple sources, which would be handy for me driving a very accurate clock to multiple FDC2214s.


It's not clear to me, however, whether they can be used just like a crystal oscillator would be. Datasheets seem to specifically mention crystal oscillators, but don't say a thing about these clock sources. Can they be hooked up to the same pins?


Another question I had is that I've found a pack of crystal oscillators to give a go and learn about. They don't mention the load capacitance for any of the crystals - how do I figure that out experimentally if I were to get them?


Datasheets and links:
 

Offline Ionforbes

  • Contributor
  • Posts: 48
  • Country: gb
The type of clock used will depend on the device. The Atmega for example doesn't have to use a crystal, if you look at the datasheet section 6.6 it shows you can apply an external clock signal, be it a MEMS with a CMOS output, clock source IC or even mashing a pushbutton. Section 29.3 describes the clock drive waverform like max rise/fall times, minimum high time etc.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9985
  • Country: us
So I'm looking at using a micro (ATMega32U4 or STM32G031) for a project, as well as one or more FDC2214 capacitance to digital converters. All of these ICs have the option to use an external oscillator to improve accuracy.


I've not used a crystal oscillator before and so I had a google. Some alternatives came up like clock source ICs and MEMS. They seem to claim a lot of benefits, such as being able to drive multiple sources, which would be handy for me driving a very accurate clock to multiple FDC2214s.

A crystal OSCILLATOR is a complete assembly and requires no external load capacitance.  It will produce a square wave of the proper frequency all by itself.  The output will be a logic level signal, either CMOS or some form of TTL.  I would probably want one with CMOS output and a voltage that matches the driven device.

A crystal, by itself, will require some kind of external capacitance and the recommended value is usually specified in the datasheet.  Or, at least, the total capacitance.  But that implies you can figure the load capacitance as the parallel combination of the 2 load capacitors and the PCB and driven device.  Check the datasheet for recommended circuits.

When there is a choice, a crystal oscillator is the way to go.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17649
  • Country: us
  • DavidH
Another option is to use the out pin of the crystal oscillator circuit built into the microcontroller to drive both the external crystal and other microcontrollers.
 

Online magic

  • Super Contributor
  • ***
  • Posts: 7566
  • Country: pl
Another question I had is that I've found a pack of crystal oscillators to give a go and learn about. They don't mention the load capacitance for any of the crystals - how do I figure that out experimentally if I were to get them?
You probably found a pack of crystal resonators or just "crystals". Metal cans with two terminals and a piece of quartz inside.
As others said, oscillator is a complete circuit including a crystal, amplifier (built into most MCUs) and capacitors. Or you can buy a canned oscillator with simple GND,VCC,OUT terminals.

For load capacitors I use 22pF in my hobby builds because it's a common value. I get frequency within two digit ppm of what's printed on the can and I don't care about better accuracy most of the time. The way to figure it out is to measure if the frequency is right. More capacitance - lower frequency.

22pF is a little high, giving 11pF load capacitance before even accounting for parasitic capacitance of PCB and MCU pins. The datasheets of crystals in the 1~20MHz range often ask for a bit under 10pF. Atmel recommends to consult the datasheet or 12~22pF if you have no clue. For inspiration, you can go to some supplier like Digikey and read datasheets of quartz resonators similar to whatever you found.
« Last Edit: August 11, 2021, 08:34:55 pm by magic »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf