The fundamental timing of the interrupt controller is Fpclk / 4. In my case that is 133 MHz / 4 = 33.25 MHz. I have a PWM period corresponding to a frequency of 2.5 MHz (checked on an oscilloscope), so the interrupt controller is running fast enough to latch the PWM interrupts. In my PWM ISR I toggle a DPI output pin, so I expect this pin to be toggled every 400 ns. However, the DPI output pin is toggled every 1 us - 1.5 us and is not in sync with the PWM interrupts!!
Here is how I configured my PWM:
SRU2(PWM1_AH_O, DPI_PB07_I ); /* connect PWM1 to DPI pin 7 */
*pSYSCTL |= (PWMONDPIEN | PWM1EN); /* Enable PWM1 module */
*pPWMGCTL = PWM_EN1 | PWM_SYNCEN1; /* PWM1 enable */
*pPWMCTL1 = 0; /* PWM IRQ disable */
*pPWMPERIOD1 = PWM_PERIOD_CNTS; /* PWM period register = 53 */
*pPWMDT1 = 0; /* PWM dead time register */
*pPWMA1 = 0; /* PWM channel A duty control */
*pPWMSEG1 = ~(0x04); /* PWM output enable */
*pPWMAL1 = 0; /* PWM channel AL duty ctrl */
*pPICR0 &= ~(0x1F << 0);
*pPICR0 |= (0x18 << 0);
*pPWMCTL1 |= PWM_IRQEN;
Here is my PWM ISR:
*pPWMGSTAT |= 0x000F; //acknowledge interrupt
Does anyone have any idea what is causing this behaviour?
Thanks in advance for your support.