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 related questions F28335 (Delfino)

Hello!

I am currently trying to program a switching scheme using F28335. I am using 3 ePWM modules to generate 3 phase signals (six signals). I want to generate a "new signal" which depends logically on the current/instantaneous states of the 3 ePWM outputs. Also, there is an ePWM based interrupt which updates the duty ratios at the CTR=0.

If I try to generate the "new signal" in the infinite "for" loop, it creates problems. The problem is because the Cpu is processing the interrupt for sometime and this leads to the halting/blanking of "for" loop. So any change in ePWM during this blanking time, the "new signal" can not change as desired.

Is there any other way(besides the infinite loop) to generate a "new signal" logically dependent on 3 ePWM modules?

I also have another question related to Interrupt in ePWM module. Is there a way to trigger ePWM module based interrupt for both Count up (CMPA) and Count down (CMPA) event? Or simply, is it possible to generate interrupts at more than one compare event?  

Thank you for your help!

Best regards,

Pawan

  • Is there a way to trigger ePWM module based interrupt for both Count up (CMPA) and Count down (CMPA) event? Or simply, is it possible to generate interrupts at more than one compare event? 

    If you check the Event-Trigger Selection Register (ETSEL) in ePWM doc for F28335. Interrupts can be generated only for a single compare event.

    Regards,

    Gautam

  • Thank for responding Gautam. I suspected that. Is there a way I can change the ETSEL register inside the interrupt? I have not tried doing it. 

  • Hi Pawan,

    I believe that you can change the ETSEL register within the interrupt, but you'll need to be careful about it.  More research would be needed.

    If you are only using 3 ePWMs, you should be able to synchronize 3 more ePWM modules with your existing 3.  This will allow you to generate an interrupt on all your PWM transition events.  If the frequency of your PWMs are less than maybe 75kHz than this is might be the method I'd take.

    Since you mentioned that you are using other interrupts in your system, you will need to enable nested interrupts so that the logical combination waveform is generated correctly. 

    For the F2833x, I cannot really think of a sneaky way to accomplish what you want in an easier way.  My only thought might be to tie some amount of your PWM pins to trip zone (TZn) inputs.  In this way you may not have to call an interrupt for all your ePWM transitions - maybe only half of them, but you'd have to research this.    (you'd use a PWM module output to be the host of your combination waveform;  the TZ signal could directly force the PWM high or low and then you'd have to clear the trip zone flag at the next transition).   Note that this is likely more trouble than it is worth, but I thought that I'd mention it anyway.

    ---

    {
    For other potential readers of this post who have other C2000 devices:  On devices (such as Piccolo) that have on-board comparators I can think of some tricky ways to potentially make things easier via the analog comparators and the ePWM's Digital Compare Unit.  On the F28M35x, F28M36x and F28377x, the ePWM has 4 compare modules which would simplify things as well.
    }


    Thank you,
    Brett