Hi,
So randomly after like few thousands of cycles EPWM ISR is not called.
So is there anything wrong I am doing with initialization of EPWM or setting something? It works almost so long so hard to find the problem.
Thanks,
Sagar
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.
Hi,
So randomly after like few thousands of cycles EPWM ISR is not called.
So is there anything wrong I am doing with initialization of EPWM or setting something? It works almost so long so hard to find the problem.
Thanks,
Sagar
Can you give more details on this? What do you mean by "stop pulsing after 1000 pulses" & then "randomly after like few thousands of cycles EPWM ISR is not called"?
I mean give 1000 pulse PWM fora dc motor and disable clock and switch off PWM. And then I start PWM for 1000 pwm Pulse.
For each end of PWM Pulse I have Epwm ISR interrupt generated. But after having the above pattern the Epwm ISR is not called while I still have the pulsing going on for some time.
So this time I had my probe connected and I manually made EPwm1Regs.ETCLR.bit.INT = 1 in command window (even though I clear it in my epwm ISR) and then it started to trigger the ISR again.
So i am not sure if I am doing incorrectly or something else.
Thanks,
Sagar Shah
I don't see why you need to disable the clock when all you want to do is stop PWM pulses from being produced. The issue you originally described is likely caused by some timing issue when you do that. I have described how to accomplish the same thing without disabling the clock - you can keep the PWM running but re-configure it to output low always. Yes.
Regards,
Richard
ALSO I have Question regarding how to enable EPWM clock and other sequence after I complete a move of pulses as shown above.
void Start(){ // after Recieving start from the API
EALLOW;
SysCtrlRegs.PCLKCR1.bit.EPWM1ENCLK = 1;
EDIS;
EPwm1Regs.TBCTL.bit.CLKDIV = 0x6;
EPwm1Regs.TBCTL.bit.HSPCLKDIV = 0x0;
EPwm1Regs.ETSEL.bit.INTEN = 1; // Enable INT
EPwm1Regs.ETSEL.bit.INTSEL = 1;
EPwm1Regs.ETCLR.bit.INT = 1;
EPwm1Regs.TBPRD = CPU_CLK/(2*pulse_speed); // pulse_speed is a Uint16 (ranges from 400- 1500)
EPwm1Regs.CMPA.half.CMPA = (EPwm1Regs.TBPRD +1)/2;
}
void STP(){ // After receiving stop from the API
EPwm1Regs.CMPA.half.CMPA=0;
EPwm1Regs.TBPRD=0;
EALLOW;
SysCtrlRegs.PCLKCR1.bit.EPWM1ENCLK = 0;
EDIS;
}
So is the above sequence correct? Should I put EPwm1Regs.TBCTR=0; in the start or somewhere else?
Thanks for the help.
I believe I have similar Init in my code. But I still have not understand that once after all my start condition and after enabling Epwm1 ISR to trigger. It some how did not to go into the isr and in the command window I put this EPwm1Regs.ETCLR.bit.INT and made it equal to 1. then suddenly it began to go into isr regularly.
So if you can make me understand that why did that happen?
Also in your code above you have PieCtrlRegs.PIEACK.all = PIEACK_GROUP3;
EPwm1Regs.ETCLR.bit.INT = 1; at the beginning of the ISR (instead having it at the end) while I have it at the end of ISR. So is it done on purpose like this?
Thanks