cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous PWM output and input at the same timer (STM32H7B0)

SHaue.2
Associate II

Hi,

I'm using Timer 3 channel 4 for the PWM output und channel 2/1 as a combined PWM input where channel 2 is the direct input.

If I feed the output pwm to the input, I don't get a capture value in CCR2, only in CCR1.

Can I use the output and input simultaneously at all on the same timer?

Kind regards,

Stefan

3 REPLIES 3

Yes you can, but if by "combined PWM input" you mean that you reset the timer through slave-mode controller, PWM won't work as you expect i.e. period set to ARR gets effectively ignored and you'll see only short pulses on the output.

> I don't get a capture value in CCR2,

What does this mean?

Read out and check/post the timer registers content. Timers are simple enough to be programmed directly by registers.

JW

SHaue.2
Associate II

It seems that CCR2 is counting up to the ARR value set by pwm output and then reset, what I then read out. In this constellation I can only measure signals that have a higher frequency than the current pwm output to not get a higher CCR2 than ARR.

This also means that pwm output and input isn't really independent.

Read the timer chapter in RM, it describes the timer functionality in detail. You may want to read it multiple times, performing experiments as you go. The related appnotes (AN4013 and AN4776) are worth reading, too.

JW