2025-03-27 6:26 AM
Can someone tell me if I’m understanding this correctly?
In the documentation for the STM32F030R8T6 chip, specifically the "RM0360 Reference Manual", there’s a diagram showing how to connect an external crystal oscillator ("Figure 12. HSE/LSE clock sources"). In this diagram, the crystal is connected directly to the OSC_IN and OSC_OUT pins, with no series resistor on the OSC_OUT line to limit the drive level.
However, on the STM32F030 DISCOVERY board, there is such a resistor – R22 – even though the crystal is not installed by default. I added the crystal I wanted to use and measured the current through it (using a current clamp), and it became clear that it was being driven beyond its specified power limits. That’s when I realized the need for the series resistor (R22). I calculated the appropriate resistance value and installed it – but it didn’t reduce the current through the crystal at all.
After further investigation, I discovered that the OSC_OUT pin on the microcontroller is actually a high-impedance input, while OSC_IN is the output. So I tried placing the resistor in series with OSC_IN instead – and, as expected, this reduced the power dissipated in the crystal.
Is my understanding correct? And if so, does that mean the diagram in the official documentation is actually incorrect?
Solved! Go to Solution.
2025-03-27 10:43 AM
@mega3psp wrote:In the documentation for the STM32F030R8T6 chip, specifically the "RM0360 Reference Manual", there’s a diagram showing how to connect an external crystal oscillator ("Figure 12. HSE/LSE clock sources"). In this diagram, the crystal is connected directly to the OSC_IN and OSC_OUT pins,?
No - in the case of an external oscillator (ie, an external clock), it is connected to OSC_IN only - the OSC_OUT pin is free for use as GPIO:
Both pins are only used in the case of an external crystal:
Difference between an oscillator an a crystal:
@mega3psp wrote:on the STM32F030 DISCOVERY board, ... I added the crystal I wanted to use
Did you also remove SB16 et al - to disconnect the drive from the ST-Link?
2025-03-27 10:43 AM
@mega3psp wrote:In the documentation for the STM32F030R8T6 chip, specifically the "RM0360 Reference Manual", there’s a diagram showing how to connect an external crystal oscillator ("Figure 12. HSE/LSE clock sources"). In this diagram, the crystal is connected directly to the OSC_IN and OSC_OUT pins,?
No - in the case of an external oscillator (ie, an external clock), it is connected to OSC_IN only - the OSC_OUT pin is free for use as GPIO:
Both pins are only used in the case of an external crystal:
Difference between an oscillator an a crystal:
@mega3psp wrote:on the STM32F030 DISCOVERY board, ... I added the crystal I wanted to use
Did you also remove SB16 et al - to disconnect the drive from the ST-Link?
2025-03-28 1:41 AM
The issue was indeed caused by the SB18 solder bridge being in place. After I removed it, everything started working as expected. That is, OSC_IN is the input and OSC_OUT is the output. So, to limit the drive level, the R22 resistor on the STM32F030 DISCOVERY board should be used.
Huge thanks for your help!