2015-03-27 08:06 AM
Hi,
I'm working with an STM32F103RB.I try to do a PWM input capture (frequency and duty) and also PWM output with the same TIMER.It seems there is a problem.My pwm output restarts when a rising edge occurs on thepwminput.For the PWM Input capture, i'm using TIM3 channel 1 (and channel2 for duty cycle) and for PWMoutput, i'm using TIM3 channel 3.If I activate only the PWM Input, it works.And also, if I activate only the PWMOutput, it works.Is there a limitation or maybe I forget to disable a reset ?Thanks #stm32f103 #pwm #timer2015-03-27 08:12 AM
PWM Input resets the timer, that's how it works. The TIM only has a single counting element.
I don't see using the same timer to do measurement and PWM output, the periodicity of the timer is going to be rather limiting. If I really had to do this for myself, I'd using Input Capture, with a maximal period, using two channels to time stamp opposite edges, and I'd use Toggle Mode to control the output signal.