Skip to main content
pietro2
Associate III
October 11, 2012
Question

TIM1 to TIM3 PWM

  • October 11, 2012
  • 2 replies
  • 771 views
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?

 

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    October 11, 2012
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    pietro2
    pietro2Author
    Associate III
    October 12, 2012
    Posted on October 12, 2012 at 10:40

    thanks clive