Skip to main content
Visitor II
September 23, 2022
Question

STM32F4 Hardware for external clock

  • September 23, 2022
  • 3 replies
  • 3715 views

I want to develop my own PCB using STM32F4. I want to use one external clock (16 MHz). I wonder where I have to connect the clock: OSCIN32-OSCOUT32 (pins 3 and 4) or OSCIN-OSCOUT (HSE) (pins 5 and 6 in STM32F446RET).

I can see in the development board's schematic how there is an empty footprint for X3 (pins 5 and 6) and I don't know if it is using the debugger's clock.

Thanks in advance.

    This topic has been closed for replies.

    3 replies

    ST Employee
    September 23, 2022

    Hello,

    the OSC32 pins are for LSE (32kHz) oscillator, so in your case it is the second pair.

    For more information about PCB design guidelines for oscillators refer to AN2867 (https://www.st.com/resource/en/application_note/cd00221665-oscillator-design-guide-for-stm8afals-stm32-mcus-and-mpus-stmicroelectronics.pdf).

    Jaroslav

    DElec.1Author
    Visitor II
    September 23, 2022

    Ok, thank you. I did not know if it were necessary to add two capacitors even if you just want the HSE one. I was having some trouble trying to run code and I think it had to do with the oscillator.

    Graduate II
    September 23, 2022

    The NUCLEO / DISCO boards typically source an 8 MHz crystal based source from the ST-LINK's MCO output.

    Watch for solder bridges or zero ohm routing of signal.

    H​SE should use BYPASS mode for external clocks. Use OSCIN only. Check is source or TCXO expects capacitive loading.

    DElec.1Author
    Visitor II
    September 23, 2022

    In my PCB I use an external 16 MHz crystal oscillator connected directly to the OSCIN-OSC-OUT pins. The schematic includes two capacitors (value = 2 * (Cload - Cstray) = 26 pF). Do I need to set anything special (apart from basic clock configuration, input, freq, etc) in STMCubeIDE?

    0693W00000Sw5naQAB.png 

    Graduate II
    September 23, 2022