Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

PWM signal in f28049c card using C2000 code generator

0 votes

I am trying to implement a code in my f28049c to control the TI boostxl-buckconv card (a synchronous buck converter). I wanted to do a test asking for two GPIO to input a square wave (pulse generation block) to the mosfets at a frequency of 20 kHz with a duty cycle of 0.5 and discretization period of 5e-6 s. I am measuring the gate signal with an oscilloscope and could not see any signal. If I implement a signal of 10 kHz with a discretization of 1e-5 it is working but every time the discretization is less than 1e-5s I could not get any gating signal. Does anybody have a solution to that or ran through this issue? I need to implement an MPC control algorithm with at least a sampling of 25e-6 s(40 kHz).



T. Harzig
asked Apr 26 by T. Harzig (12 points)

1 Answer

+1 vote

Hi Harzig,

I was not able to implement a step size of 5e-6 seconds (200 kHz) either, I think it is too fast for this controller. However a sample step size of 12.5e-6 seconds (80 kHz) seems to work.

I implemented the attached model on a 280049C launchpad. There are two subsystems. The subsystem labeled "280049_pwm" is using a PWM block instead of the digital outs. The advantage of this implementation is that irrespective of the duty cycle value, you can have a sample step-size same as the switching period.

The subsystem labeled "280049_digital" is using a pulse generator block. The disadvantage here is that you need to consider the duty cycle value in the sample step-size. For example, for a switching frequency of 40e3 and duty cycle of 0.5, the sample step size must be an integer multiple of 0.5/40e3.

If you want to further discuss your controller implementation, email us at


answered Apr 27 by Manu Parimi (295 points)