cancel
Showing results for 
Search instead for 
Did you mean: 

Change Clock Source to 16MHz

s61331
Associate II
Posted on January 11, 2017 at 09:13

Hello,

where can i change the MCU Clock to 16MHz?

In the Workbench its not possilbe.

Can i change the Value in the Control Stage Parameters.h file?

/* ext. clock frequency */

#define EXT_CLK_8_MHZ

to

#define EXT_CLK_16_MHZ

with friedly greetings

Eric

1 REPLY 1
s61331
Associate II
Posted on January 25, 2017 at 08:52

Hello, the Problem is solved.

The define (#define EXT_CLK_8_MHZ) doesnt change anything.

You have to change the HSE Value in stm32f30x.h

from

#define HSE_VALUE            ((uint32_t)8000000)

to

#define HSE_VALUE            ((uint32_t)16000000)

and the RCC_CFGR_PLLEXTPRE_PREDIV1 factor in system_stm32f30x.c

from

/* PLL configuration */

RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL));

RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_PREDIV1 | RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLMULL9);

to

/* PLL configuration */

RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL));

RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_PREDIV1 | RCC_CFGR_PLLXTPRE_PREDIV1_Div2 | RCC_CFGR_PLLMULL9);