cancel
Showing results for 
Search instead for 
Did you mean: 

system clock stm32f0 ?

abdelaziz
Associate II
Posted on July 29, 2015 at 16:08

hi' i'm new stm32f0 user and i working on stm32f072 , my first question what is value of system clock of microcontroller when i use system_stm32f0xx.c file which found in

stm32f0_stdperiph_lib\STM32F0xx_StdPeriph_Lib_V1.5.0\Projects\STM32F0xx_StdPeriph_Examples code example , i know the table in top of this file tell me that the freq is 48000000 HZ  but when i toggal any pin from main loop like this

{

GPIOA->ODR  ^= 0xffff;

}

and i see the output in oscilloscope the freq is 400 KHZ

and when i toggale like this

{

GPIOA->BSRR;

GPIOA->BRR; 

}

the freq is 1MHZ 

what is the fault? and what is the real speed of microcontroller? 
1 REPLY 1
Posted on July 29, 2015 at 16:18

Toggling pins is not a good metric for how fast the processor is running. You'd have to look at the assembler code generated by the compiler to understand what inefficiencies are coming from than.

If you want to physically confirm them, use the MCO (PA8) pin and export the internal clocks.

If you want to see what the current settings of the PLL and peripheral buses are, use the RCC_GetClocks() or equivalent API function and print them out.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..