cancel
Showing results for 
Search instead for 
Did you mean: 

Combined PWM mode

DRH
Associate III

Hi,

I'm using the combined pwm mode using STM32L431 TIM2 and noticed this information in the reference manual RM0394, page 845.

"When a given channel is used as combined PWM channel, its secondary channel must be configured in the opposite PWM mode (for instance, one in Combined PWM mode 1 and the other in Combined PWM mode 2)."

For the signal I need I like to work with both channels in the same PWM mode and in practice it works at expected, but I'm wondering if there is another reason that it must be configured in the opposite mode?

One issue I 'm afraid is even it's working today as expected, maybe something will change in the future?

Thanks for any clarification and confirmation that working in the same PWM mode will be possible as well.

3 REPLIES 3

The combined mode ANDs the two channel's output. If you set both to the same PWM, the output is equal to the "shorter" pulse of the two, which defeats the purpose of combining.

You may want to draw timing diagram of the signal you want to achieve and its constituents.

JW

DRH
Associate III

Thanks for your quick response. It's an OR I use and therefore it can make sense, at least for me.

Think of a pwm output that get's the CC value from an external source but the timer shall limit the minimum duty cycle to a defined value. If channel 1 CC getting input between 0-max and channel 2 CC is defined with a fix value (y), the result will be the signal explained above. An output getting an input between 0 and x but providing an output between y and x.

Actually the output is exactly as I like but I'm afraid about the mentioned sentence and that it said it "must" be configured in the opposite more.

> Actually the output is exactly as I like but I'm afraid about the mentioned sentence and that it said it "must" be configured in the opposite more.

IMO in this case this is just an unfortunate wording and there's nothing to be afraid of.

When reading the RM, focus primarily on the description of the registers, that's usually the more precise and technically oriented portion.

[rant mode on] The narrative part in RM is usually written in a very naive manner, and rather than giving a precise description of design of the given peripheral top to bottom, it is "user" oriented and focuses on "usual cases". This is for example witnessed by "PWM input mode" chapter (which is not a special mode of the timer's hardware, just a combination of settings). This is the same mindset which makes ST to push Cube/CubeMX clicky, rather than write concise examples with accompanying application notes.

JW