cancel
Showing results for 
Search instead for 
Did you mean: 

TIM1 to TIM3 PWM

pietro2
Associate II
Posted on October 11, 2012 at 09:48

Good morning, i'm working with a stm32F0-Discovery board (cortex M0), i need to change the PWM pin from PA8 (using TIM1) to PC8 (using TIM3), but there is a problem because it works wrong.

In the following codes i highlight the changed lines

the working code (with TIM1/PA8) is the ''START CODE'' attached file

and the chaged code is ''NEW CODE'' attached file.

The effect is that if i press the user button (PA0), then on  PC8 pin i see a PWM with about 95% dutycyle, and if PA0 is not pressed then there are nothing on PC8 pin.

Can you help me please?

 

2 REPLIES 2
Posted on October 12, 2012 at 01:30

PC8 is TIM3_CH3, you need to be programming it as Channel 3, not channel 1

I'm not sure how the DAC1 was paced on TIM1 in the original.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
pietro2
Associate II
Posted on October 12, 2012 at 10:40

thanks clive