cancel
Showing results for 
Search instead for 
Did you mean: 

Generation of odd freq with Timer Peripheral

officialkesh
Associate III
Posted on April 25, 2016 at 14:20

Hi ,

I want to generate signal equal to 2.048MHz for audio codec IC which need to be very precise .

Right now I have configured TIM8 CHN3 with per-scaler = 0 and period = 40 and timer peripheral clock is around 84 MHz .

With this nearest value that I have got around 2048780 Hz.

Prescaler = 0 and Period = 40 => 84 MHz / (40+1) = 2048780 Hz

Prescaler = 0 and Period = 41 => 84 MHz / (41+1) = 2000000 Hz

Prescaler = 0 and Period = 39 => 84 MHz / (39+1) = 2100000 Hz

Is there any other-method in this scenario ?  Please let me know

- Pinkesh

#stm32f4 #timer #discovery
2 REPLIES 2
Posted on April 25, 2016 at 15:07

Correct. The TIM uses two integer dividers.

You'd get specific numbers by using crystals, and pll settings, to achieve the desired starting point. ie you'd use an 8.192 MHz crystal, not a 8.0 MHz one. You'd clock the APB/TIM at 81.92 MHz, not 84 MHz, etc.

Look also at the I2S PLL also, and what you can do with the three factors there.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
officialkesh
Associate III
Posted on May 13, 2016 at 17:34

Thanks clive1 . Using PLLI2S_N , PLLI2S_R  and and with Mco2 prescaler , I am able to generate .