🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

duty cycle and frequency of EPWM

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

Submitted by akowal on Wed, 05/30/2012 - 23:43 

 

Im using the f28335, is it possible to change both the duty cycle and the period of the pwm? My schematic is attached, currently I either have to have the duty cycle constant (0.5) and vary the frequency via the timer period pin, or have a constant frequency and vary the duty cycle.

   

Unable to find an attachment - read this blog

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Submitted by anthony on Thu, 05/31/2012 - 13:35.

    Hi akowal,

    The problem with your diagram is that you are toggling the PWMA on the counter = zero condition. This then never considers the %Duty Cycle input on A and the duty cycle remains constant at 50%. You should do something (0, 1 or T) on the CMPA up or down (or both) to change the duty cycle. I have attached a simulation diagram using the digital power block set (you will need to download and install it first) with which you can clearly visulaize what you're doing in a simulation environment.

    Unable to find an attachment - read this blog

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Submitted by Anders89 on Thu, 05/31/2012 - 21:44.

    @akowal, Anthony is exactly right. And his attached simulation is spot on to show how the TI PWM unit works. I've modified your original diagram slightly to change the Action Qualifier as Anthony suggests. I use sliders to modify duty and period. If you put GPIO 0 on a scope you'll see it works as advertised.

    Unable to find an attachment - read this blog