Open faunel opened 3 weeks ago
When using the timer in PWM input mode, channels 1 and 2 will be used as inputs. However, channels 3 and 4 remain free, but they cannot be used as PWM output.
I even did not know something like this is possible. Input and output PWM on one timer.
Yes, in the STM32 microcontroller, it is possible to configure the same timer to work simultaneously as both an input (PWM input) and an output (PWM output), using different channels for each mode. This allows, for example, measuring an incoming PWM signal on one channel and generating an outgoing PWM signal on another channel of the same timer.
However, the functionality of PWM output will be somewhat limited. The timer has a shared clock generator, so the frequencies of PWM input and PWM output will depend on the same base clock signal.
You can configure different parameters for each channel, such as the duty cycle and other settings, but the main PWM frequency will be shared across all channels of a single timer.
Therefore, I think it’s not worth spending time adding such functionality, as it will be quite specific and limited. I just thought I was doing something wrong, but it turns out this is not implemented.
I like your idea. But I need some time to think over the details.
When using the timer in PWM input mode, channels 1 and 2 will be used as inputs. However, channels 3 and 4 remain free, but they cannot be used as PWM output.
Previously, in version 0.21.0, this was not possible because the timer was moved to the ownership of the
pwm_hz
method.I thought that with the new version 0.22.0, where the timer is split into a PWM manager and channels, this would be possible. But it still doesn't work.