Reputation: 3
I'm new to stm32 timers and have a question concerning triggering.
I would like to generate four squarewaves two of each complements of each other. That is the trivial part.
Now I would like to introduce a variable phaseshift between each of the two complementary signalgroups. (Phaseshift PWM)
Now my question, can I trigger timer 2 on the falling or rising edge of a pwm signal produced by timer 1?
Or is there another way for me to generate a phaseshift between those signals that's changeable during runtime?
Upvotes: 0
Views: 1173
Reputation: 1
Regarding your question you can use master-slave mode to turn on one timer using the other when an event occurs(just edge of PWM is not enough) see "internal trigger connections" table in ref manual to see possible triggers, but as said above the best way to generate such signals is to use embedded dead time.
Upvotes: 0
Reputation: 5510
A single advanced control timer (TIM1 or TIM8) can do all of this for you.
See the reference manual section 17.3.11 "Complementary outputs and dead-time insertion".
Alternatively you can chain timers, see section 13.3.15 of the same manual.
Upvotes: 0