Skip to main content
Visitor II
November 1, 2021
Solved

STM32G030F6 OSC_EN

  • November 1, 2021
  • 5 replies
  • 2908 views

Hello,

I am using STM32G030F6, use HSE, but when I set the system clock, PA14 change to OSC_IN but while PA15 change to OSC_EN, and I can't find any specification of this defini0693W00000GW2fsQAD.pngtion, can I use it as OSC_OUT?

    This topic has been closed for replies.
    Best answer by Peter BENSCH

    PC15 ist an input push-pull output with default value low and optional pull-up or pull-down, if you configure it as OSC_EN.

    Please find some more information in the reference manual RM0454, section 5.2.1, subsection External source (HSE bypass):

    The OSC_OUT pin can be used as a GPIO or it can be configured as OSC_EN alternate function, to provide an enable signal to external clock synthesizer. It allows stopping the external clock source when the device enters low power modes.

    Note: For details on pin availability, refer to the pinout section in the corresponding device datasheet.

    (remark: as mentioned earlier OSC_OUT is not available at smaller packages than the LQFP48).

    Regards

    /Peter

    5 replies

    Technical Moderator
    November 1, 2021

    Hello @Qwang.2​  and welcome to the Community :)

    Do you mean PC14 and PC15 (not PA) ?

    I advise you to refer to the STM32G030 datasheet to identify the pins assignment (free/usable pins)

    0693W00000GW4BBQA1.jpg 

    0693W00000GW4BkQAL.jpg 

    When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

    Imen

    Technical Moderator
    November 1, 2021

    Due to pin restrictions, the TSSOP20 is somewhat restricted in its features, e.g. OSC_OUT is not available. You can find it e.g. in the datasheet @Imen DAHMEN​ mentioned, just a few lines below: OSC_OUT is only available in LQFP48, pin 9. Within STM32CubeMX (standalone or as part of STM32CubeIDE) it is only possible to set BYPASS Clock Source, so just OSC_IN can be used for HSE and optional OSC_EN.

    You need to switch to LQFP48 if you want to use HSE with a crystal instead of an external clock source/oscillator.

    Regards

    /Peter

    Qwang.2Author
    Visitor II
    November 2, 2021

    Ok, so have can you use PC15(OSC_EN)? as an output or else? Can I just connected it with the enable pin of Oscillator? If yes, this means this pin will be output high by default? or the oscillator will not work, because it will not be enable.

    Technical Moderator
    November 2, 2021

    PC15 ist an input push-pull output with default value low and optional pull-up or pull-down, if you configure it as OSC_EN.

    Please find some more information in the reference manual RM0454, section 5.2.1, subsection External source (HSE bypass):

    The OSC_OUT pin can be used as a GPIO or it can be configured as OSC_EN alternate function, to provide an enable signal to external clock synthesizer. It allows stopping the external clock source when the device enters low power modes.

    Note: For details on pin availability, refer to the pinout section in the corresponding device datasheet.

    (remark: as mentioned earlier OSC_OUT is not available at smaller packages than the LQFP48).

    Regards

    /Peter

    Qwang.2Author
    Visitor II
    November 2, 2021

    Hi, Peter

    As the doc say, PC15 can be configured as OSC_EN alternate function, to provide an enable signal to external clock synthesizer, my understanding is that IO should be an output, so it can enable the external oscillator, while you say it is an input. I am confused, if it is an input, how it realize function to enable the external oscillator?

    Regards,

    Marvin

    Technical Moderator
    November 2, 2021

    You are right, I corrected my statement above.

    Regards

    /Peter

    Qwang.2Author
    Visitor II
    November 2, 2021

    Hi, Peter

    Thanks a lot, so I will connect PC15 with my enable pin of oscillator.

    Regards,

    Marvin

    Qwang.2Author
    Visitor II
    November 5, 2021

    Hello, peter

    Another question, about BOOT, I find that PA14-BOOT0, but if this MCU has 3 BOOT modes, it need 2 IOs to control, but I can't find the second IO, how can I set the BOOT mode? Or to debug, download firmware?

    Regards,

    Marvin​

    Technical Moderator
    November 5, 2021

    Hi, Marvin,

    it looks like the original question has been answered. Please create a new topic for further questions.

    Regards

    /Peter