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.
I am using ePWM1 on the F280049C to control a stepper motor. I am generating a symmetrical 50% duty cycle pulse train because CMPA is always 1/2 of PRD. I need two interrupts, one when CTRU = CMPA and another when CTR = PRD... one at the start of the pulse and one at the end. On page 1868 of the TRM I see that both these signals can generate interrupts and I see that multiple interrupts named EPWMxINTn can be sent to the PIE. So with this information I want to create two interrupts:
Interrupt 1 EPWM1INT0 which occurs every time CTR = PRD
Interrupt 2 EPWM1INT1 which occurs every time CTRU = CMPA.
However when I look at epwm.h, it is beginning to look like you can have only 1 interrupt per PWM module. If this is the case, why does the TRM indicate the name of the interrupt is EPWMxINTn? This implies that for any particular x, such as ePWM1, there can be more than one interrupts generated, such as INT0 and INT1. I think this nomenclature is in error. Am I right?
I have looked at all the ePWM examples in the resource explorer and I don't see anything there that helps.
I am new to TI and this particular processor. If I cannot generate these two interrupts from the event trigger module, can you think of any other way I can generate these two interrupts?
Thinking about this further, I suppose I could use ePWM2 configured identical to ePWM1 and generate one interrupt form ePWM1 and the other from ePWM2 but this seems like a waste of a PWM peripheral. Also, will it be difficult to keep the two PWM exactly synchronized?
Clark
Hi,
Yes, it looks like at few places TRM mention the interrupts as EPWMxINTn along with EPWMxINT at other places. There can be a single EPWM INT for each PWM instance Thanks for reporting this and this will be fixed in the next TRM version.
It is not possible to generate single interrupt on both CTR = 0 or PRD and CTRU = CMPA events. Can you elaborate more on the use case for the need of interrupt on two events so that we can suggest any other alternative, if possible.
Thanks
Vasudha
Vashdha
Thank you for clearing this up for me and for getting the changes made to the TRM.
As far as my use case, I am currently converting a program that was originally written for the MSP430G2553 to the F280049C. The G2553 has the capability to generate multiple interrupts and the author of the app took advantage of it. After I created the thread, it occurred to me that I can probably use just one interrupt. I still have to think more about this before I can be sure.
I will get this resolved one way or the other over the weekend. Can you leave this thread open for a couple more days?
Clark
Hi,
It is not possible to generate single interrupt on both CTR = 0 or PRD and CTRU = CMPA events, but you could toggle between interrupt sources from inside the interrupt code:
On CTR=0 interrupt, set interrupt source to CTRU=CMPA
On CTRU=CMPA interrupt, set interrupt source to CTR=PRD
On CTR=PRD interrupt, set interrupt source to CTR=0
Regards,
Stephan