2021-07-30 12:57 AM
I would appreciate if someone could provide me with some tips about how to accomplish this in an optimal way.
I want to generate a square signal in one pin, and exactly the double in other, both must be synchronized.
My first approach was to use one timer with 2 outputs in output compare and "toggle on mach" but both signals have the same frequency, and I only can change the phase with the "pulse" register
As this timers have 4 channels I was thinking in using 1 channel to generate a base signal, and the other channels to toggle the output pin each n number of counts, but I don't know how to do that.
BTW this is a generic question about timers, but I'm working with a Nucleo F722, using CubeIDE 1.7.0 and the HAL libraries.
Solved! Go to Solution.
2021-07-30 05:36 AM
You can do this by setting one channel with 50% PWM and the other channel with toggle on match. I've done it.
Print out relevant TIM registers if this isn't working for you.
2021-07-30 05:36 AM
You can do this by setting one channel with 50% PWM and the other channel with toggle on match. I've done it.
Print out relevant TIM registers if this isn't working for you.
2021-08-02 12:47 AM
Done it, and works for me. Thanks!