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.

Help increase ePWM interrupt speed

Hello.  I have written some code to trigger interrupts based off of the TI example.

With the values I am using the max speed I can achieve is roughly 100kHz.  With a 20MHz clock on the board, I should be able to get much faster times out of this.

I have attached my initialization function. 

I would think that if my clock ratio to SYSCLKOUT and clock divider were both 1, then I should be clocking my time based counter at 20 MHz.  With a period time of 2, I should be getting a 5MHz timing should I not?

Let me know if you see anything out of place.

Thanks

-Cam

   EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UP; // Count up
   EPwm1Regs.TBPRD = EPWM1_TIMER_TBPRD;       // Set timer period (value = 2)
   EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE;    // Disable phase loading
   EPwm1Regs.TBPHS.half.TBPHS = 0x0000;       // Phase is 0
   EPwm1Regs.TBCTR = 0x0000;                  // Clear counter
   EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1;   // Clock ratio to SYSCLKOUT
   EPwm1Regs.TBCTL.bit.CLKDIV = TB_DIV1;      // Clock Divider

   // Setup shadow register load on ZERO
   EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;
   EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
   EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO;
   EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO;

   // Set Compare values
   EPwm1Regs.CMPA.half.CMPA = PULSE_TIME;    // sets pulse width time (value = 2)
   EPwm1Regs.CMPB = PULSE_TIME;             // Sets pulse rate.  (value = 2)

  // Interrupt where we will change the Compare Values
   EPwm1Regs.ETSEL.bit.INTSEL = ET_CTR_PRD;      // Select INT on period event
   EPwm1Regs.ETSEL.bit.INTEN = 1;                // Enable INT
   EPwm1Regs.ETPS.bit.INTPRD = ET_1ST;           // Generate INT every event.

(value = 2)