AnsweredAssumed Answered

STM32F4 APB1 Prescaling Issue

Question asked by hill.jonathan on Apr 19, 2014
Latest reply on Apr 19, 2014 by waclawek.jan
Hi all,

I'm curious about prescaling APB1 for the STM32F4. I'm building a triangle wave generator and frequency meter, for which it is conveniant for me to have a high as possible clock frequency for Timers 4 and 6. Therefore I've been playing with the APB1 prescaler (ie bits 12:10 of RCC_CFGR).

I have a function adapted from the STM DAC output example which produces a triangle wave, using TIM6 as its clock base. I've got a function written so I can basically get any frequency in the range 1Hz to 166kHz.

By default (according to my system_stm32f4xx.c) the APB1 has a prescaler of 4 from a HCLK which I happen to know is running at 168MHz. When I change the APB1 prescaler to 2, my output frequency accordingly doubles. When I try to change it 1 however, it just prescales it to 2.

Then I noticed the ref manual (RM0090) says you can't prescale the APB1 below 42MHz which kind of explains it, but doesnt explain why it manages to prescale the APB1 by a value of 2 when its initially 42MHz .Any thoughts about this, anyone with experience prescaling APB1?