AnsweredAssumed Answered

STM32F4 TIM2 setup for PWM - solved

Question asked by pavelm on Mar 21, 2015
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.

Outcomes