Choosing the HSE Crystal Oscillator

Thread Starter

kalemaxon89

Joined Oct 12, 2022
241
I need to design a pcb with the stm32f103c6t8 and using the HSE.
The external high speed clock (HSE) can be provided with a 4 to 16 MHz crystal oscillator/resonator ceramic.

Having never worked with pcb, I found on jlcpcb a lot of crystals .. but I don't know which one to choose.
Can you help me out with the choice?
(maybe it's an easy choice, but I'm a beginner anyway)

I also take the opportunity to ask if I should get it at 16 MHz or should I go a bit lower in values (since 16 MHz is the maximum value of the micro I'm using).


Thanks!
 

DickCappels

Joined Aug 21, 2008
10,169
I would fist look at my supplier's inventory and see what they have that would be usable in your circuit, then select the pattern that corrosponds to the available part.

Microcontrollers (an assumption, I admit) spec'd to run at 16 MHz will run fine at 16 MHz.
 

Papabravo

Joined Feb 24, 2006
21,225
I need to design a pcb with the stm32f103c6t8 and using the HSE.
The external high speed clock (HSE) can be provided with a 4 to 16 MHz crystal oscillator/resonator ceramic.

Having never worked with pcb, I found on jlcpcb a lot of crystals .. but I don't know which one to choose.
Can you help me out with the choice?
(maybe it's an easy choice, but I'm a beginner anyway)

I also take the opportunity to ask if I should get it at 16 MHz or should I go a bit lower in values (since 16 MHz is the maximum value of the micro I'm using).


Thanks!
The only additional advice I can offer is that if you want to have an asynchronous serial port operate at a "standard" bit rate you might want to choose an operating frequency that is an exact multiple of that bit rate. In many cases you can find a value that is quite close to the maximum. The advantage of doing this is more reliable serial communications as the bit rate goes higher, with a slight sacrifice in overall instruction execution speed.

For example, with an 8MHz. ATmega128 I chose a frequency of 7.3728 MHz. because 7.3728 MHz / 115,200 b/s = 64

The slight loss in performance was well worth the increase in reliability of the serial communications link.
 
Last edited:

MrChips

Joined Oct 2, 2009
30,795
The common crystal frequency is 8MHz.
The MCU CLK frequency itself is programmable using a PLL (phase locked loop).
Choosing an exact frequency such as 7.3728MHz is not necessarily a better choice. If your other device is also an MCU with an 8MHz crystal then your serial communication rates will be "exact" within an error of 10ppm or whatever difference there is between the two crystal frequencies.
 

Papabravo

Joined Feb 24, 2006
21,225
The common crystal frequency is 8MHz.
The MCU CLK frequency itself is programmable using a PLL (phase locked loop).
Choosing an exact frequency such as 7.3728MHz is not necessarily a better choice. If your other device is also an MCU with an 8MHz crystal then your serial communication rates will be "exact" within an error of 10ppm or whatever difference there is between the two crystal frequencies.
AFAIK the ATmega128 did not have that option and with an 8MHz. crystal the serial port had frequent errors when trying to communicate with a PC at 115,200 bits/sec.
 

MrChips

Joined Oct 2, 2009
30,795
I run STM32F407 with 8MHz crystals. The MCU clock is 168MHz. I interface with PC serial communications using SiLabs CP2102 AT 460800 baud and have never experienced a problem.
 

Ian0

Joined Aug 7, 2020
9,803
I need to design a pcb with the stm32f103c6t8 and using the HSE.
The external high speed clock (HSE) can be provided with a 4 to 16 MHz crystal oscillator/resonator ceramic.

Having never worked with pcb, I found on jlcpcb a lot of crystals .. but I don't know which one to choose.
Can you help me out with the choice?
(maybe it's an easy choice, but I'm a beginner anyway)

I also take the opportunity to ask if I should get it at 16 MHz or should I go a bit lower in values (since 16 MHz is the maximum value of the micro I'm using).


Thanks!
They will all work. Use 12MHz or 16MHz. If you have any serial communications going on with "standard" baud rates, choose a crystal frequency that nicely divides down to the standard baud rate.
It will probably need load capacitors, 15pF or 22pF generally work.
Don't think any more about it.
 
Top