cancel
Showing results for 
Search instead for 
Did you mean: 

changing the prescaler of AHB and APB on STM32F4

anes
Associate
Posted on June 22, 2014 at 11:22

Hello everybody, is it possible to chage the prescaler of the bus APB or AHB on the STM32F4 dev board. In fact, I was taking a look on the library system_stm32f4xx.c and it was descripbing a few setting oh the microcontrollers including the prescaler of AHB, APB1 and APB2 (1, 4 and 2). So I am juste wondering if it's possible and if it is, wich function does the job.

NB : the functions are certainly not 

void RCC_PCLK1Config(uint32_t RCC_HCLK)

and

void RCC_PCLK2Config(uint32_t RCC_HCLK)

because in their description, they mensionned that they ''configure the Low Speed APB clock'' and not set the value of the prescaler as does

 

void TIM_PrescalerConfig(TIM_TyoeDEF*  TIMx, uint16_t Prescaler, uint16_t TIM_PSCReloadMode )

and there are only 5 values possible to configure the clock wich not as chould be for a prescaler configuration.

Thank you for your support and have a nice day 😉

void RCC_PCLK1Config ( uint32_t  RCC_HCLK )

#abp #ahb #stm32f4
2 REPLIES 2
Posted on June 23, 2014 at 00:05

Well the functions are RCC_HCLKConfig() for AHB, RCC_PCLK1Config() for APB1 and RCC_PCLK2Config() for APB2. And you do have a finite choice of power's of two, based on the logic being gated.

These are not the same sort of programmable prescaler/counter ahead of the timers.

You should review the clock tree in the reference manual to understand your choices. APB1 should also not be faster than APB2

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on June 23, 2014 at 00:08

If you want more frequency choices you can play with the values of the multiplier/divider chains in the PLL, and change the crystals.

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