cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 TIM2 setup for PWM - solved

zexx86
Associate II
Posted on March 21, 2015 at 14:32

Hello,

could anybody help me with settings this timer to work correctly, please?

I use 3 timers, each timer should behave same - same PWM output characteristics (frequency), TIM2, TIM8 and TIM12.

All these timers are little bit different, but TIM2 is probably the most different and I don't know how to make it work correctly.

TIM2 has 32bit resolution while rest have 16bit.

My code for timebase settings is here:

http://pastebin.com/cAbTPFkx

I think that problem is only there. Or do I have to send different values for TIM_SetCompare ?

I think that no, sice only resolution is higher, timer configuration (TIM_Pulse) should be same. Or am I wrong?

I have measured output with osciloscope and I can clearly see, that TIM2 output is much higher frequency and smaller duty. So definitively I have to shift bytes or something like that.

Thank you very much.

UPDATE: Problem solved! Sorry it was an issue in the source code, that during porting to new CPU there were other parts bound to TIM2 and overwriting settings for this part.

0 REPLIES 0