2015-12-04 10:07 AM
Hello, I'm working with STM32F4 and I'd like to stop PWM after N periods automatically like explained in this [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Stop%20PWM%20output%20after%20N%20steps&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=2935]post.
In this post TIM3 is the master and TIM1 (PWM, trigger mode) is its slave and is configured in ''one pulse'' mode.Everything works seamlessly as far as TIM1 and TIM3 start sequentially (i.e. TIM1 first and TIM3 after)Hence, I would expect that PWM output wave starts after the TIM3 enable occurs, but this does not seem to be true.In fact, if, for example, I enable PWM by TIM1, wait for a delay and after start TIM3 (I need to make it like this, because I need TIM3 to be a slave of an upper level master), I see on the scope one PWM shoot (N periods) before TIM3 is startedSo my question is: Why do I get an output before TIM3 starts?I have an idea, but I would like to get your opinion.regards #stm32f4 #pwm #discovery #output2015-12-04 06:14 PM
>
In fact, if, for example, I enable PWM by TIM1, In Trigger mode, you are not supposed to enable the timer ''by hand'', writing into TIM1_CR1.CEN; rather, it's the slave controller which sets it when TRGI arrives. Read the noe below CEN bit's description. JW2015-12-09 12:50 AM