2
\$\begingroup\$

Disclaimer: I am programmer and when it comes to analog circuits I have no idea what I am doing.

I have a board with STM32F103 that uses external oscillator made by crystal and two capacitors:

current schema

The crystal is CD05M008000RD1 / 49SMD-8-20-20 described as 8Mhz, 20pF, 20ppm, ESR 60Ohm.

Everything seems to be working fine, but I am trying to reduce the board size and the crystal is rather big. I am looking for either smaller crystal or a complete oscillator in small package.

I found for example this: O 8,0-JO32-B-1V3-1-T1-LF described as XTAL OSC XO 8MHZ HCMOS SMD, 50ppm.

Can I use it so that it will look like this?

enter image description here

I see that it is less precise (20ppm vs 50ppm), but for my use-case it should be well within the limit. It is still way better than the internal oscillator. Are there any other differences that I am not seeing?

\$\endgroup\$
7
  • 2
    \$\begingroup\$ You are asking to replace an oscillator with a CLOCK IC, not an oscillator IC. If the MCU has registers that can change the oscillator input to be a clock input then, yes. I'm not aware of any STM32F that don't but you should check since your pin names of PD0 for the clock in pin seems a bit odd. \$\endgroup\$
    – DKNguyen
    Jan 8, 2020 at 17:11
  • 2
    \$\begingroup\$ What does the STM32F103 datasheet say about using an external oscillator instead of a crystal? \$\endgroup\$
    – The Photon
    Jan 8, 2020 at 17:11
  • \$\begingroup\$ It says both are possible, use capacitors in range 5 to 25 pF matching the crystal's requirements, etc etc. I know I can use some external oscillator, but I wonder what to look for when picking one. \$\endgroup\$
    – michalsrb
    Jan 8, 2020 at 17:18
  • 1
    \$\begingroup\$ @michalsrb Again, not an external oscillator. An external clock. There's a difference. An oscillator is no more a clock than an engine is a car. It is easier to pick an external clock than it is to pick an external crystal/oscillator. CMOS output should be fine. The MCU is just expecting a regular digital square wave if it is an external clock. Nothing fancy. \$\endgroup\$
    – DKNguyen
    Jan 8, 2020 at 17:26
  • 1
    \$\begingroup\$ also, what's your application? If it's something that doesn't need a good time / frequency standard, what's stopping you from not having any oscillator or external clock at all? I think all STM32 have internal RC oscillators that you can use instead. \$\endgroup\$ Jan 8, 2020 at 17:50

4 Answers 4

5
\$\begingroup\$

From the datasheet both types can be used. Just select the type in FW.

enter image description here

enter image description here

\$\endgroup\$
1
  • \$\begingroup\$ In general, the oscillators with 8 MHz output should work, as long as the output square wave fits into the specification (CMOS output) and it is fed to OSC_IN pin, and the STM32 firmware is modified to select external square wave clock input instead of the external crystal. \$\endgroup\$
    – Justme
    Jan 8, 2020 at 20:01
2
\$\begingroup\$

You can find 3.2 x 2.5mm crystals https://www.digikey.com/products/en/crystals-oscillators-resonators/crystals/171?k=crystal&k=&pkeyword=crystal&sv=0&pv46=10964&sf=1&FV=1989%7C0%2Cmu8MHz%7C2150%2C-8%7C171%2C69%7C409393&quantity=&ColumnSort=0&page=1&stock=1&pageSize=25

Surely that and two 0402 caps are smaller than an oscillator that you also have to run power to? I stand corrected - you can find 8 MHz oscillators that are 1.6 x 1.2mm! https://www.digikey.com/products/en/crystals-oscillators-resonators/oscillators/172?k=oscillator&k=&pkeyword=oscillator&sv=0&pv46=7836&sf=1&FV=1989%7C0%2Cmu8MHz%7C2150%2C-8%7C172%2C276%7C174115&quantity=&ColumnSort=0&page=1&stock=1&pageSize=25

Are those small enough for you?

\$\endgroup\$
3
  • \$\begingroup\$ Amazingly small. So those should work fine in my case as well? \$\endgroup\$
    – michalsrb
    Jan 8, 2020 at 18:17
  • \$\begingroup\$ I would expect it to. \$\endgroup\$
    – CrossRoads
    Jan 8, 2020 at 19:07
  • \$\begingroup\$ Small crystals tend to have larger ESR than large crystals, so you really have to look at the crystal parameters, and STM32 HSE oscillator parameters, and do the math explained in STM32 crystal application note to find out if the crystal is suitable or not. This is not a problem with the oscillators that output square wave to STM32. \$\endgroup\$
    – Justme
    Jan 8, 2020 at 19:58
0
\$\begingroup\$

Are you prepared to learn all the details of Xtal Osc (XO) tuning and uW power limitations and Q and Xtal temperature curves ,range and PPM for temp, PPM for initial tolerance and PPM for C variations and design error?

If not use the SMD XO (Standard). It will probably be more accurate, very tiny and can be tunable(VCXO), temperature compensated (TCXO) or both (TCVCXO) or programmable, etc. and low cost but maybe not cheapest in high volume.

Your discrete design could have more tolerance stackup:

  • 20 ppm for ΔTmax=?, or more?
  • 20 ppm @ 25'C
  • 20~50ppm for C load design error & other tolerances.

Since all AT cut Xtals have different 3rd order temp curves , the ppm temp tolerance depends greatly on ΔTmax e.g. -25 ~40'C vs -40~70'C

You have a choice of temp range and ppm tolerance. vs cost vs volume.

\$\endgroup\$
0
\$\begingroup\$

I came across this and just wanted to give some feedback on what I came across while dealing with this same problem. The MCU I am using the STM32G031. What I discovered is, don't go by only what is said in the datasheet. You have to look at the reference manual. The datasheet for the STM32G031 did not specify that the STM32G031 could take an external clock source as depicted in Aaron's answer.

Almost all STM32 MCUs allow for the HSE and sometimes the LSE to be selectable as either Crystal/Ceramic Oscillator or BYPASS Clock Source. For the Crystal/Ceramic Oscillator, you have both an input and an output from the MCU as OSC_IN and OSC_OUT. With BYPASS Clock Source you get only OSC_IN, which, for example, would get the square wave CMOS output from a TCXO. You can do this right from CubeMX or do it manually. Here is the section in the reference manual that describes it.

External source (LSE bypass) In this mode, an external clock source must be provided. It can have a frequency of up to 1 MHz. You select this mode by setting the LSEBYP and LSEON bits in the Backup domain control register (RCC_BDCR). The external clock signal (square, sinus or triangle) with ~50% duty cycle has to drive the OSC32_IN pin while the OSC32_OUT pin should be left Hi-Z.

I checked this on another MCU I had used and it was the same thing. I had seen the BYPASS Clock Source in CubeMX many times, but never knew what it mean't until now that I actually have to use. I believe the language they are using here for this option is something like this: The STM32 has a built in op amp style circuit that, when combined with your supplied oscillator (eg. crystal), makes a clock. You may also BYPASS the "MCUs clock" and provide your own in the form of, for example, an external TCXO (that has it's own built in mems or crystal resonator) with a square wave output.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.