cancel
Showing results for 
Search instead for 
Did you mean: 

Issues about STM32H723 Timer1 PWM Generation

pliao.1
Associate II

I have a problem with Timer1 PWM generation.

We need to generate three pairs complementary PWM signals. The compare value can be modified at counter overflow and underflow event, as below shows.0693W00000WJqFiQAL.pngIt seems the PWM center-aligned mode can’t meet the requirement.

It should use the Asymmetric PWM mode, but there are only two pairs complementary PWM signals can be generated in this mode,.

What should I to produce the PWM waveform I want 

6 REPLIES 6
Javier1
Principal

>>three pairs complementary PWM signals

Are you trying to drive a motor or an inverter?

>>It seems the PWM center-aligned mode can’t meet the requirement.

why not?

we dont need to firmware by ourselves, lets talk

Yes, I want to drive a motor.

As the above pic. shows, we need to change the rising edge and the falling edge through change the compare value at T1 and T2, tests found, the falling edge time wasn't changed, falling edge compare value is same as the rising falling edge,even through the value has been changed at T2 in the pwm center-aligned mode,as the red dash line shows.0693W00000WJv2PQAT.png

ap.1
Associate II

Hello if I understood correctly u want to change compare value for falling edge of ur pwm , that means you want to have diffrent compare value on your rising edge and falling edge , use an intruppt either when cnt match arr or when cnt match compare1 value and change the ccr value in that intruppt to compare2 and again use another intruppt (when cnt match compare2) to change the ccr to compare1 value.

(p.s. cnt is the counter , Arr is your Auto Reload Register , and ccr is your compare value )

AScha.3
Chief II

maybe you want 2 separate adjustable point in time, you cannot use center aligned mode, because this is doing , what the name suggest: symm. around center.

what could be perfect for you, is combined mode --> read in rm, how to do. Tim1 can do this mode.

but : usually to drive a motor you need only "standard" pwm, + complement. outputs (with deadtime) , x3 for 3-phase motor..

If you feel a post has answered your question, please click "Accept as Solution".

>>Yes, I want to drive a motor.

Youyre probably trying to implement FOC current controlled drive.

A lot of people (including me) is already driving motors that way, maybe look at their usage of TIM, it only takes a bit of research to realise youre reinventing the wheeel here.

Center aligned mode should work and its the mode used for this kind of motor control, Both edges should change in center mode PWM generation so im more inclined to believe you messed up somehwere in the PWM config.

we dont need to firmware by ourselves, lets talk

Hi Javier,

Thanks for your reply. The register configuration is incorrect,the issue is resolved.

compare register preload should be enabled