Can a clock be used to replace a crystal oscillator in most/all scenarios? - Page 1
Forum section: electronics / beginners

author: frasdoge
author_rank: Contributor
timestamp: August 11, 2021, 01:35:40 pm
content: 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:https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdfhttps://www.st.com/resource/en/datasheet/stm32g031k8.pdfhttps://www.ti.com/lit/ds/symlink/fdc2214.pdf?ts=1628688104225&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FFDC2214https://docs.rs-online.com/f474/0900766b812f2b7e.pdfhttps://core-electronics.com.au/crystal-oscillator-pack-35pcs.html

author: Ionforbes
author_rank: Contributor
timestamp: August 11, 2021, 02:03:38 pm
content: 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.

author: rstofer
author_rank: Super Contributor
timestamp: August 11, 2021, 02:52:12 pm
content: Quote from: frasdoge on August 11, 2021, 01:35:40 pmA 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.

author: David Hess
author_rank: Super Contributor
timestamp: August 11, 2021, 07:00:14 pm
content: 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.

author: magic
author_rank: Super Contributor
timestamp: August 11, 2021, 08:31:45 pm
content: Quote from: frasdoge on August 11, 2021, 01:35:40 pmYou 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.