Other Parts Discussed in Thread: LAUNCHXL-F28069M
Tool/software: Code Composer Studio
Hi,
I am working with board LAUNCHXL-F28069M.
The aim of my program is to generate two sinusoidal waveforms for a power converter. For that, I am using PWM1 and PWM2. Both PWM are configured in the exact same way.
Since the output is a sinusoidal waveform, duty cycle must vary continuously. At the current stage of the development, I am trying to get the same output in both PWMs. In order to do so, I update PWM as:
EPwm1Regs.CMPA.half.CMPA = EPwm1Regs.TBPRD * duty;
EPwm2Regs.CMPA.half.CMPA = EPwm2Regs.TBPRD * duty;
I always make sure that duty is between 0 and 1 prior to the update. Duty is defined as float.
Here is my problem:
-If duty is a constant value or is varied manually by me as an expression, everything works correctly.
-If duty is varied following a sinusoidal pattern, program compiles but does not run.
-If I fix the duty for PWM1 to a constant value and I let it vary for PWM2, it compiles and runs. This does not work the other way around (fixing PWM2 and varying PWM1).
Any clue on what could be happening?
Best Regards.
