Skip to main content
Evelyn Sabbag
Associate
March 20, 2018
Question

STM32F407 with a 50.0MHz Oscillator

  • March 20, 2018
  • 5 replies
  • 3963 views
Posted on March 20, 2018 at 19:00

I am running an STM32F407 with an ECS-2033-500BN Oscillator (50.0MHz) to accommodate the MCU and the ETH off the same oscillator. The circuit uses a fanout buffer to distribute the clock. Nowhere can I find information on how to configure the STM32F4 system clock with this high of a value (I assume there's a divide by 2 enabled in the bowels of the MCU) and the Clock Configuration tool doesn't help. Any suggestions? And yes, I've looked through the forum and the datasheet and I haven't been able to get the circuit to run.

I know the circuit works because previous FW was developed using NuTTx. I am porting the code to IAR and am stuck at the PLL initialization in the generated file system_stm32f4xx.c at the line: 

/* Wait till the main PLL is ready */

while((RCC->CR & RCC_CR_PLLRDY) == 0)

{

}

Any help would be greatly appreciated.

 
    This topic has been closed for replies.

    5 replies

    Jan Waclawek
    Visitor II
    March 21, 2018
    Posted on March 21, 2018 at 08:13

    With external clock source you should set HSE to BYPASS.

    To which pin is the clock connected?

    You can check it with outputting HSE to MCO pin.

    JW

    Andrew Neil
    Super User
    March 21, 2018
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    AvaTar
    Senior III
    March 21, 2018
    Posted on March 21, 2018 at 08:49

    50 MHz seems a bit high  - officially (DS) only quartz frequencies from 4.0 MHz to 24.0 MHz are supported.

    Andrew Neil
    Super User
    March 21, 2018
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Evelyn Sabbag
    Associate
    March 21, 2018
    Posted on March 21, 2018 at 14:15

    Thank you, Andrew, for the reply. The datasheet, DM00037051.pdf, mentions the 50 MHz OSC in Figure 98, but doesn't really provide any more information. The reference manual, en.DM00031020.pdf, is what I was missing. However, other than the bypass, it doesn't provide the same level of detail as the Clock Configuration tool. 

    Once the bypass is selected and HSE is on, how does the /2 get selected? From the block diagram, either /2 or /20 is possible. And, once this is setup, can the HSE be treated as 25MHz in order to set the other parameters? I.e. PLL_N, PLL_Q, PLL_M, etc?

    Thank you for all the help.

    henry.dick
    Associate II
    March 21, 2018
    Posted on March 21, 2018 at 13:13

    '

    Nowhere can I find information on how to configure the STM32F4 system clock with this high of a value...'

    you mean the datasheet says nothing about that? seems to be a major flaw,

    Andrew Neil
    Super User
    March 21, 2018
    Posted on March 21, 2018 at 14:46

    ST - like many (most?) others - split the description of their products across two documents:

    1. The Datasheet - covers physical parameters; electrical, timing, mechanical specifications, etc

       
    2. The Reference Manual - covers operation of the various parts, registers, etc
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    waclawek.jan
    Super User
    March 21, 2018
    Posted on March 21, 2018 at 16:17

    From the block diagram, either /2 or /20 is possible.

    Which block diagram are you talking about?

    And, once this is setup, can the HSE be treated as 25MHz in order to set the other parameters? I.e. PLL_N, PLL_Q, PLL_M, etc?

    No, treat it simply as 50MHz... As far as PLL is concerned, the simplest way is to take the parameters you had for 25MHz and multiply the predivider (PLL_M) by two.

    JW

    Tesla DeLorean
    Guru
    March 21, 2018
    Posted on March 21, 2018 at 16:21

    Sounds like an L4 part

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Bill Dempsey
    Associate III
    March 21, 2018
    Posted on March 21, 2018 at 17:38

    For some reason I don't see anyone mentioning the obvious - STMCube clock manager.  You can set 50MHz and then tweak away at the internal dividers  This is an example.  It can produce the necessary clock setup code only if that's what you want.

    0690X0000060ACVQA2.png