cancel
Showing results for 
Search instead for 
Did you mean: 

From which output of the Crystal oscillator is the signal for clocking the microcontroller taken?

MMust.5
Senior II

STM32F407


_legacyfs_online_stmicro_images_0693W00000biXIiQAM.png
_legacyfs_online_stmicro_images_0693W00000biXIdQAM.pngUsually the signal is taken from the PH1-OSC_OUT pin if it is a parallel resonant oscillator circuit.

The signal for clocking the microcontroller is formed on the Crystal oscillator X2, fed to the microcontroller and amplified in the microcontroller.

If so, why is PH0-OSC_IN also connected to the microcontroller?

The MCO(PH0-OSC_IN) signal is needed only to generate a signal on the Crystal oscillator X2, why is this signal fed to the microcontroller?

If you disable PH0-OSC_IN from the microcontroller, then the signal from the Crystal oscillator X2 will continue to be fed to the microcontroller via  PH1-OSC_OUT.

Why is PH0-OSC_IN connected to the microcontroller then?

1 ACCEPTED SOLUTION

Accepted Solutions
AScha.3
Chief II

>From which output of the Crystal oscillator is the signal for clocking the microcontroller taken?

what you ask about ? disco board? ok, i assume: STM32F407G-DISC1

so see manual->schematic -> clk for F407 (osz-in) is coming from st-link F103 (MCO).

as long as F103 is powered and send MCO (8MHz) clk, F407 oszillator and X2 crystal are just "decoration" .

question answered. - ok ?

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

19 REPLIES 19
LCE
Principal

In your 2nd picture there is only a passive crystal which does nothing on its own, only with the MCU's internal "amp" it's becoming an oscillator. Both IN and OUT are needed to create a positive feedback loop to keep it oscillating.

If you are using an external active oscillator (which usually has voltage supply, GND, and an output), then you connect it only to the IN of the MCU - and must set that in software accordingly (HSE_BYPASS or so).

The external active oscillator basically consists of a crystal and the amplifier circuit integrated in the MCU, usually with a stronger driver.

MMust.5
Senior II


_legacyfs_online_stmicro_images_0693W00000bkToUQAU.pngIf this is an input, then why does the Pierce generator need a signal on PH0-OSC_IN?

The Pierce oscillator generates a signal using an inverter, a quartz resonator and capacitors.

MCO - Main Clock Output.

I don't understand the signs very well.

MCO should be an output, what does the yellow MCO arrow pointing to the microcontroller mean then?

0693W00000bkTrdQAE_inv.png

There is such a description, but it is not clear from it exactly where the MCO signal is generated.

The description says: MCO from ST-LINK. MCO generated in ST-LINK?

------------------

MCO from ST-LINK: MCO output of ST-LINK MCU is used as input clock. This frequency cannot be changed, it is fixed at 8 MHz and connected to PF0/PD0/PH0-OSC_IN of STM32 microcontroller.

Of course, I may be wrong and most likely it is, but maybe there is an error in the circuit notation and the MCO signal is generated on the Pierce generator in the STM32F407VGT6 microcontroller and then goes to ST_LINK_V2 STM32F103C8T6?

(The description says the opposite: MCO FROM ST-LINK)

When I need to change the frequency, then I need to change the X2 Crystal, and do not disassemble the ST_LINK controller to change the frequency.

But it is strange that it is written that this frequency cannot be changed, because this frequency can be changed if the Crystal is replaced.

AScha.3
Chief II

>From which output of the Crystal oscillator is the signal for clocking the microcontroller taken?

what you ask about ? disco board? ok, i assume: STM32F407G-DISC1

so see manual->schematic -> clk for F407 (osz-in) is coming from st-link F103 (MCO).

as long as F103 is powered and send MCO (8MHz) clk, F407 oszillator and X2 crystal are just "decoration" .

question answered. - ok ?

If you feel a post has answered your question, please click "Accept as Solution".

What is X2 for then?

I soldered R68 out and the 8 MHz signal disappeared on PH0-OSC_IN.

X2 does not start generating signal after the MCO signal is lost.


_legacyfs_online_stmicro_images_0693W00000bkUABQA2.png 

now : useless.

if you remove/de-solder R68 (= disconnect MCO ), X2 + F407 set to external clock are the 8MHz source then.

the designer was probably drunk, because this clk circuit looks like.

also on my F407 board LSE , 32kHz crystal, is fitted, but in diagram is marked as "not fitted" .

on some newer boards the circuit is clear: (nucleo-G0B1RE MB 1360 )


_legacyfs_online_stmicro_images_0693W00000bkU9rQAE.pngclk coming from st-link MCO and other parts not fitted.

0693W00000bkUA1QAM_image.png

but to try, can fit missing parts and open SB17 , then local crystal is clk source.

on (old) F407 boards this "switch" SB is missing.

If you feel a post has answered your question, please click "Accept as Solution".