duty cycle and frequency of EPWM
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.
Answers
-
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.
0 -
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.
0