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 and interrupt

I have a question about one of the example code in controlsuit named "epwm_updown_aq". There is an interrupt function that updates the Compare register values of the ePWMs.

Why do we need that? We can make the same thing on the main while loop. What is the advantage of the interrupt function?

Thank you

Have a nice day.

  • Hi Fatih,

    fatih kara said:
    Why do we need that? We can make the same thing on the main while loop. What is the advantage of the interrupt function?

    Yes, why not! You can write the same in the main too but what if your epwm control is the most important/ top priority task? You need your first decision to alter the duty rather than doing some other computations!

    Hence, interrupt is very much necessary when it comes to power electronics based apps where ADCs and PWMs are heart of the system.

    Regards,

    Gautam