2014-06-22 02:22 AM
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 notvoid RCC_PCLK1Config(uint32_t RCC_HCLK)
andvoid 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 doesvoid 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 #stm32f42014-06-22 03:05 PM
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 APB22014-06-22 03:08 PM
If you want more frequency choices you can play with the values of the multiplier/divider chains in the PLL, and change the crystals.