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.

TMS320F28374S: PWM interrupt not firing

Part Number: TMS320F28374S
Other Parts Discussed in Thread: C2000WARE

I am trying to trigger an interrupt off of a PWM. If I do a manual Hwi_post, I can see the GPIO toggle, but the EPWM module is not triggering an interrupt. I am using driver lib functions as follows:

    SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM4);
    EPWM_setInterruptSource(EPWM4_BASE, EPWM_INT_TBCTR_ZERO);
    EPWM_enableInterrupt(EPWM4_BASE);
    Hwi_plug(EPWM4_PIE_INTERRUPT_NUMBER, (Hwi_PlugFuncPtr)toggleGPIO1);
    Hwi_enablePIEIER(EPWM4_INTERRUPT_GROUP, 1);
    Hwi_enableIER(4);
    EPWM_setCounterCompareValue(EPWM4_BASE, EPWM_COUNTER_COMPARE_A, comparatorCount);
EPWM_setInterruptSource
(EPWM4_BASE, EPWM_INT_TBCTR_ZERO);

Please let me know what I am missing. Thank you.
  • Hi Sujeeth,

    There are some missing components that maybe are not just shown in the snippet that you attached like setting a period value for your epwm module. I would suggest looking at one of our EPWM C2000Ware examples. All of the examples utilize interrupts so you can observe how the EPWM module is configured and how to setup interrupts. 

    C:\ti\c2000\C2000Ware_version\driverlib\f2837xs\examples\cpu1\epwm

    Best Regards,

    Marlyn