This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

epwm interrupt at both CTR=ZERO and CTR=PRD

Other Parts Discussed in Thread: TMS320F28335

Hi,

I am using TMS320F28335 controller and operating pwm module in up-down counter mode.

I want to update the compare registers of pwm module twice with in a period. ie at ctr=0 & ctr=prd.

can i change the value of INTSEL during run time after initializing the epwm module?

  • I've never tried such a thing but does it give an error?

    Regards,

    Gautam

  • Kiran,

    Under most circumstances I wouldn't do things the way that you are thinking.  Instead, I would consider using up-count mode for simplicity, reduce you PRD value by half, and setup an interrupt to fire once every period. 

    The only exception might be if you want on-time-A as the PWM counts up and on-time-B each time the PWM counts down or something weird like that. 

    If you give some more details on what you're trying to accomplish, we may be able to suggest something more elegant for your specific situation.


    Thank you,
    Brett

  • Hi Bret,

    I have to setup a Dual-edge asymmetric waveform as in page 50 of the ePWM documentation SPRUG04A.

    Ay want to update one edge at zero evet of the counter and the other edge at period event of the counter.

    Based on the bits: EPwm1Regs.ETSEL.bit.INTSEL it seems that it is only possible to have an interrupt on one of those events but not in the two events. Is this ok?

    Can you give me any suggestion on what you think it would be an elegant way to do this?

    Thanks,
    Fernando.
  • Hi Fernando,

    The last post in this thread is from a few years ago. If you don't get a response, it may be a good idea to start a new thread describing what you are having trouble accomplishing. Feel free to reference this thread if it is relevant.