Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

XMC™ Forum Discussions

Not applicable
Hello

I want to generate two pwm with 90 degree phase shift.

Afterward I have a low pass filter to get 1MHz sine waves.

For a better filtering I want to use a PWM with higher frequency than 1MHz and a changing duty-cycle.

Can someone recommend a a specific DAVE3 app for this? I already configured two 1MHz PWMs with 90 degree phase shift with de pwmmp001 app.

How do I have to configure this APP?

Thanks a lot

Thom
0 Likes
1 Reply
Eric1
Employee
Employee
Hallo Thom,
If I understand you right, you want to create two 1MHz analog sine waves which are shifted by 90°.
For this you can also use the DAC. If a resolution of 32 steps per Period and 64 steps in Amplitude is enough you have to configure it once and do not need any SW interrupt. For a higher resolution you can use a look up table the DACWG003 App do this.

If you want to stay at a digital output two points are important:
Do you need only one output or do you also need the complementary output with dead time? For the first approach you can use CCU4 Unit. If you need dead time you can use CCU8 Unit.
Second: Do you want to create a sin wave with many pulses per wave or one pulse per wave.

For many pulses per wave you can have a look at PWMSVM App. This App is used for motor control to create 3 sine waves with 120° shift with dead time.
Here the general concept is:
Configure 2 Timers (either CCU4 PWMSP001 or CCU8 PWMSP002) a time base will interrupt periodically and change the duty cycle of both Timers. The values for the duty cycles are stored in a sine look up table.
For the periodical interrupt you can either use one of the Timers period match and update the duty cycle every X – periods. This has the improvement, that the sine “virtual” sine wave is synchrony to the Timer. Or you can configure an independent timer and change in his period the duty cycle of the other two timers. Here the improvement is that you are more flexible in the period of the sine wave. I would recommend the first solution. Also the PWMSVM App do it in this way.



Regards
Eric
0 Likes