Hello,
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 */
SRU2(HIGH, DPI_PBEN07_I);
*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;
interrupt(SIG_P0, pwm_isr);
Here is my PWM ISR:
SRU(HIGH, DPI_PB11_I);
*pPWMGSTAT |= 0x000F; //acknowledge interrupt
SRU(LOW, DPI_PB11_I);
Does anyone have any idea what is causing this behaviour?
Thanks in advance for your support.
Kind regards,
Marc