cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F3 PWM output problem

adriano
Associate II
Posted on May 09, 2016 at 13:29

Hi everybody,

I am trying to use the PWM Output feat of the board's timers. In particular, I am trying to use TIM3 to drive some DC motors.

I found an example in the CubeMX material which used the same timer to do this, and I set up my code in a similar way. I tried with both TIM1 and TIM3, and what turned out is that, while TIM1 seems to work flawlessly, when I put to 0 the value of the pulse for TIM3 the output is still different from 0 (approximately 2.3/2.4 V).

Can anybody explain me what is happening? (unfortunately I only have a tester, so I can't see the waveform on an oscilloscope)

EDIT: this only happens on channel #1 (PE2)
1 REPLY 1
Walid FTITI_O
Senior II
Posted on May 09, 2016 at 16:55

Hi ApBrandy,

I thinks you are using the STM32F303 device. 

You should check if PE2 pin configuration is correct (mode: GPIO_MODE_AF_PP , alternate: AF2 )

A similar example is in STM32CubeF3 at this path : \STM32Cube_FW_F3_V1.4.0\Projects\STM32F303RE-Nucleo\Examples\TIM\TIM_PWMOutput

-Hannibal-