AnsweredAssumed Answered

Timer change output compare mode to PWM

Question asked by reichert.sebastian on Feb 15, 2012
Latest reply on Feb 17, 2012 by virtanen.pentti
Hello,

I want to use a a advanced control timer (TIM8) of my STM32F103ZG (on STM3210E-EVAL) for motor control. I have problems generating the PWM signal at the right time. I initialize the timer the same way as in the 6-step example out of the std. peripherals lib examples, i.e.:
TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_Timing;

Later I try to start the PWM output mode with:
TIM_SelectOCxM(TIM8, TIM_Channel_1, TIM_OCMode_PWM1);
TIM_CCxCmd(TIM8, TIM_Channel_1, TIM_CCx_Enable);

This has no effect. When I use
TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
instead in the init phase, then PWM output works. I use an oscilloscope for verification.

Thanks.

best regards,
sebastian

Outcomes