Skip to main content
harry_rostovtsev
Associate II
August 27, 2012
Question

Stop PWM output after N steps

  • August 27, 2012
  • 11 replies
  • 3898 views
Posted on August 27, 2012 at 20:01

Is there a way to tell a TIMer on STM32 chips to do some number of steps and automatically stop after finished (and give an interrupt)?  I can do it now with a counter in the ISR but a few pulses slip out before I can shutdown the PWM output or the timer.

    This topic has been closed for replies.

    11 replies

    barry
    Associate II
    October 22, 2015
    Posted on October 22, 2015 at 04:02

    I have this code running correctly for Timer 8 channel 1.  When I try to use this code for other channels on Timer 8, I run into problems.

    Channel 2n  (complementary) does not work (i.e. no PWM output)

    Channel 3 continually outputs pulses

    All I have changed is the GPIO pin configuration

    and I use OCxInit for each channel.

    Does anyone know what else is channel dependent.  

    Thanks