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,
I use the ePWM to control an ac-dc converter.
The control is based on the comparison of the reference with the triangular carrier at each sampling time interruption.
However, I want to know the result of the comparison in the timer interruption k to use it in the interruption k+1.
Is it possible?
Best regards,
Monteiro
Hi Monteiro,
I want to know the result of the comparison in the timer interruption k to use it in the interruption k+1.
In short you want to get the CMPA value, right?
Regards,
Gautam
Hi monterio,
How are you using ePWM, means with triangular Carrier means ePWM internal counter ?
If you are using ePWM in normal mode you can read CMPA value in Timer ISR and use it for next cycle.
Other option is generate EPWM interrupt on an event and read CMP value in ISR.
Please describe further about your requirement.
Thank You
Dear Monteiro
i want to generate traingular and 3-sinwaves using f28335 .how to write c- code , will you please help me in this regard.my email id is anmaheshwarappa@gmail.com.
an mahesh
Hi.
I know the CMPA value... EPwm4Regs.CMPA.half.CMPA = ( pwm1);
I can read the value of CMPA in the time interruption, but is the value that I put there (pwm1).
I want to know the result of the comparison of CMPA with the ePWM internal counter ( triangular Carrier).
Tahnk you.
Monteiro
Hi,
you can read ePWM internal counter value .
and in case you are using shadow mode or direct mode reading of CMPA (shadow resister / actual resister) will give you
Current active value.
If you are interested in active value of CMPA which will cause PWM to change their state you can read this resister.
By comparing Counter value and CMPA determine in software which transition / state your PWM will take.
You can keep Timer at twice the frequency of ePWM to make sure you can calculate result of comparison before it
occurs.
I hope this answers your questions.
Thank You
Thank You
Hi Bhuvaneshwar.
Excellent! It works!
I did "a=EPwm6Regs.TBCTR;" in the timer interruption to obtain the counter value and then I use the variable 'a' to compare with other variable.
Thank you a lot.
Best regards,
Monteiro
That's great, Victor. Please close this thread by verifying Bhuvaneshwar's answer.
Regards,
Gautam