cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal vs oscillator?

sb_st
Senior II

Hi! I’m starting design of a new board, on which I’d like to use an stm32h7 device. My board will also include an audio codec and usb hs phy.

Historically I’ve used crystals to drive HSE of the mcu, but some reference designs I’ve been studying show the use of cmos oscillators to drive the clock. I am curious about the trade offs of this, or how/when I should prefer a crystal over an oscillator?

thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
EThom.3
Senior III

Back-in-the-day, when a microcontroller could run at 32 MHz or more, but had no internal frequency multiplier, I used oscillators, as it could be a pain to get a crystal to oscillate correctly much above 22 MHz. Oscillators solved that problem.

The caveat I found was that I had PCB traces with frequencies near or above 30 MHz, which is the lower limit for radiated emission measurements in generic EMC standards. The clock and its overtones can be very happy to show up when doing EMC tests.

Also, back then, oscillators tended to be power hungry. That has most likely changed a lot over the decades.

Since microcontrollers began to have internal frequency multipliers, DLLs and all that (along with USARTs that can work with fractions), I have typically used a 4 MHz crystal. Then frequencies in the VHF range and above are mainly confined to the silicon chip inside the microcontroller. No PCB traces, and smaller area ==> fewer EMC worries.

I don't find crystals hard to use, but @Andrew Neil is absolutely right that one should download and study AN2867, as opposed to throwing something random on the board.

View solution in original post

13 REPLIES 13
Andrew Neil
Super User

If you do a forum search, you'll find plenty of posts from people having trouble getting crystals to work.

See Application note AN2867Guidelines for oscillator design on STM8AF/AL/S and STM32 MCUs/MPUs, the datasheet for your chosen device, the hardware design guide, etc ...

Using a a ready-made oscillator saves you all that grief - no more worrying about load capacitors, drive strength, which cut, etc, etc, ...

They may also have reduced power consumption, smaller footprint, etc:

AndrewNeil_0-1770898507178.png

 

The downside, of course, is that they cost more.

 

This from SiTime focuses on the benefits of MEMS oscillators - but they would, wouldn't they?

Other oscillator manufacturers are available.

 

Some STM32 series may not be suitable; eg, see: MEMS oscillators not compatible with STM32F1 and STM32L1 series?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
mƎALLEm
ST Employee

Hello,

I think this is an interesting article you may refer to for your question: Do you know when to use a crystal or an oscillator? The wrong answer can cost you

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
EThom.3
Senior III

Back-in-the-day, when a microcontroller could run at 32 MHz or more, but had no internal frequency multiplier, I used oscillators, as it could be a pain to get a crystal to oscillate correctly much above 22 MHz. Oscillators solved that problem.

The caveat I found was that I had PCB traces with frequencies near or above 30 MHz, which is the lower limit for radiated emission measurements in generic EMC standards. The clock and its overtones can be very happy to show up when doing EMC tests.

Also, back then, oscillators tended to be power hungry. That has most likely changed a lot over the decades.

Since microcontrollers began to have internal frequency multipliers, DLLs and all that (along with USARTs that can work with fractions), I have typically used a 4 MHz crystal. Then frequencies in the VHF range and above are mainly confined to the silicon chip inside the microcontroller. No PCB traces, and smaller area ==> fewer EMC worries.

I don't find crystals hard to use, but @Andrew Neil is absolutely right that one should download and study AN2867, as opposed to throwing something random on the board.

Interesting article. However, I wonder why they put so much emphasis on cold start issues. The only time I have experienced problems with a crystal not starting, was when I had misread a label, and used 10 nF capacitors instead of 10 pF. Have I just been lucky?

I dunno, but I think that SiTime article might just be the slightest bit biased.


@RobK1 wrote:

I dunno, but I think that SiTime article might just be the slightest bit biased.


Arguments?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Clearly, they do have an axe to grind!

Hence I said "but they would, wouldn't they?" with my SiTime link!

 

Here's an article from ECS - a company which makes both crystals and oscillators:

https://ecsxtal.com/news-resources/crystals-versus-oscillators-why-quartz-oscillators-are-preferred-for-high-performance/

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

As @EThom.3 already mentioned, a lot of emphasis on startup and mismatch issues which, at least in my 37 years experience, are extremely rare. Also, 40 hours to correct a mismatch issue that should not have occured in the first place if the designers had done their homework?

Never had any startup problems and only one mismatch, where I had inadvertantly ordered a batch of third-overtone 32MHz crystals rather than fundamental mode.

 

Don't get me wrong, I'm not bashing oscillators; I have used them in the past and likely will use them in the future, in situations where they have a clear advantage over a crystal.


@Andrew Neil wrote:

If you do a forum search, you'll find plenty of posts from people having trouble getting crystals to work.


And yet @RobK1 and @EThom.3 have had decades of experience with no issues.

I guess the thing to bear in mind here is that only the problems get posted to the forum - the thousands of people whose crystals just work fine don't keep posting to say, "my crystal is working fine!"

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.