Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find value of APB1 Clock in STM32F429

Can anyone tell me how to find the APB1 clock frequency of STM32F429? And how to calculate the Baud Rate of STM32F429.

P.S...Please dont tell to refer Reference Manual,as those works are already done and I would like to tell me the exact value of APB1 Clock frequency

Thankyou

like image 301
user2870154 Avatar asked Nov 25 '25 20:11

user2870154


1 Answers

Using the standard peripheral library, include stm32f4xx_rcc.h then call void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks) and it will fill in the structure that you pass with the values of all the bus clocks.

The correctness of the answer depends on the value you set for HSI_VALUE or HSE_VALUE (a global uint32_t set to the value in Hz of your system's oscillator). You can find it in your application's startup C file.

You should review the values in the startup file to ensure that the core clock is generated from the source that you expect it to be (usually the PLL via the internal (HSI) or external (HSE) crystal). If they are correct and match the aforementioned global constant then the answers given by RCC_GetClocksFreq will be correct.

like image 185
Andy Brown Avatar answered Nov 28 '25 16:11

Andy Brown



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!