2016-04-25 05:20 AM
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 #discovery2016-04-25 06:07 AM
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.2016-05-13 08:34 AM