2022-01-20 11:35 AM
I have a circumstance where two PWM outputs are required, and they must be precisely coupled together. A number of the other big guy's LPC micros included an SCTimer/PWM (that's State Configurable Timer...) which, without too much magic, allows a first PWM to create events on other physical outputs at programmable delays. That is the SCTimer can generate its own PWM output and also a second but unique PWM output at an exact interval relating to the first PWM.
Is there any similar animal in the STM32 menagerie? If there is I'm sure it's called something other than SCTimer (which might be a trademark).
Otherwise, is there any way to accomplish the same thing? That is to generate a PWM (no biggie there) but also a second PWM related to but different from the first PWM?
Thanks for any thoughts!
2022-01-20 01:36 PM
Which STM32?
Timers in STM32 can be chained - one timer outputs a trigger (TRGO, see TIMx_CR2.MMS) and other acts upon it (TRGI, see TIMx_SMCR.TS and TIMx_SMCR.SMS). Not all timers connect to all other timers.
Get a cheap Nucleo or Disco board, read the Reference Manual to STM32 of your choice, and experiment.
JW
2022-01-20 01:44 PM
Thanks for your comments. I'm hot into the manuals at this moment and have noted repeated references to "timer synchronization" which sounds like what I am seeking to replicate but in STM-speak rather than NXP-speak. I've got some Nucleo's and will be trying to work through the technical details.
2022-01-20 04:20 PM
One PWM related to another PWM could be generated from a single timer if phase/duty is the difference. Would be useful to more precisely describe the output you want. Likely there is a way, or multiple ways.
2022-01-21 05:03 AM
Thanks all for your responses. Yes, the info is in the reference manual but I wasn't sure what it was called in STM32-speak and was looking for help zeroing in on it (or somebody knows it CAN'T be done, knowing that upfront would be good to know). So it looks like the functions are there in the reference manual but recalling my NXP foray into this topic found that NXP has a app note on the subject. One can argue app notes are superfluous as all the info is already in the reference manual but for we less ******** (or less proud) find them helpful. The app note format invites a more verbose discussion of the topic(s) at hand - perhaps even an example or two. Regardless, I at least now I have the previous experience and expect that should smooth the way toward implementing the functionality in the STM32.
2022-01-22 12:08 AM
Which STM32?
> app note format
[shameless self-advertisement] I have a few register-based examples at efton.sk/STM32/ [/shameless self-advertisement]
JW
PS. Note that LPTIM, if present in your STM32, are a very different beast to TIM.