cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F104RE: how to isntall/use an external clock for the board ?

duybienle
Associate II
Posted on February 06, 2017 at 09:07

Hi

I'm using the STM32F401RE Nucleo board, I have noticed that the internal clock HSI has a quite high inaccuracy over temperature and it's not suitable for my application.

I want to use an external clock for the board but I don't know how to properly install and configure the external clock?

And in STM32Cubemx, when selecting SMT32F401RE Nucleo board, in 'Clock Configuration' tab, it's not possible for choosing the HSE clock, only HSI clock available.

Any example on how to use external clock source would be great for me.

Thanks

#external-clock #stm32f401-nucleo #stm32f4 #stm32
1 ACCEPTED SOLUTION

Accepted Solutions
Nesrine M_O
Lead II
Posted on February 06, 2017 at 10:07

Hi

le.bien

,

STM32Cubemx, when selecting SMT32F401RE Nucleo board, in ''

Clock Configuration

'' tab, it's not possible for choosing the HSE clock, only HSI clock available.

You have first to enable RCC in Pinout tab :

0690X00000606CNQAY.png

Please refer to OSC clock paragraph on

http://www.st.com/content/ccc/resource/technical/document/user_manual/98/2e/fa/4b/e0/82/43/b7/DM001058pdf/files/DM001058pdf/jcr:content/translations/en.DM001058pdf

for more details about the way to configure the pins corresponding to external high-speed clock (HSE) on Nucleo board.

-Nesrine-

Ifmy suggestanswers your question, please mark it as correct.

View solution in original post

5 REPLIES 5
Nesrine M_O
Lead II
Posted on February 06, 2017 at 10:07

Hi

le.bien

,

STM32Cubemx, when selecting SMT32F401RE Nucleo board, in ''

Clock Configuration

'' tab, it's not possible for choosing the HSE clock, only HSI clock available.

You have first to enable RCC in Pinout tab :

0690X00000606CNQAY.png

Please refer to OSC clock paragraph on

http://www.st.com/content/ccc/resource/technical/document/user_manual/98/2e/fa/4b/e0/82/43/b7/DM001058pdf/files/DM001058pdf/jcr:content/translations/en.DM001058pdf

for more details about the way to configure the pins corresponding to external high-speed clock (HSE) on Nucleo board.

-Nesrine-

Ifmy suggestanswers your question, please mark it as correct.

Posted on February 06, 2017 at 13:12

Doesn't the Nucleo have 8 MHz present on the pin from the ST-LINK? Should select HSE BYPASS mode. 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
duybienle
Associate II
Posted on February 06, 2017 at 15:37

Turvey.Clive.002

Yes, I found it in the 64bit Nucleo documentation. However another problem is that after mulitplying in PLL, there is a difference between the theoretical PLLCLK and the actual PLLCLK. Namely:

PLL-setup: /M=8, *N=336, /P=4

- theoretical value PLLCLK = 84MHz

- measured value PLLCLK = 963MHz (using timer interrupt and toggle GPIO pin and measured in Oscilloscope).

Is this a known problem or I missed some specific configuration in the software ?

Thanks

Posted on February 06, 2017 at 17:10

>>

Is this a known problem or I missed some specific configuration in the software ?

You've missed something, but it is very hard to see from here.

If you want to measure the internal clocks, from the PLL etc, export them via the MCO (PA8) pin and scope them.

The TIM have a toggle mode, this would be a lot less likely to saturate than an interrupt based method. Also be aware Prescaler and Period are N-1 values.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 07, 2017 at 08:40

Yes, my problem was the prescaler value. As you said, it should have used N-1 instead of N.

Thanks