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.

How can I use PWM interrupt , TM4C1231H6PZ

Other Parts Discussed in Thread: TM4C1231H6PZ

GPIOPinConfigure(GPIO_PD0_WT2CCP0);
GPIOPinTypeTimer(GPIO_PORTD_BASE, GPIO_PIN_0);

// Configure timer
SysCtlPeripheralEnable(SYSCTL_PERIPH_WTIMER2);

HWREG(WTIMER2_BASE + TIMER_O_CFG) |= 0x04;
HWREG(WTIMER2_BASE + TIMER_O_TAMR) |= 0x20a; //PWM Interrupt enable, PWM Mode , edge-count, periodic mode
HWREG(WTIMER2_BASE + TIMER_O_CTL) |= 0x01; //Negative edge event
HWREG(WTIMER2_BASE + TIMER_O_TAPR) = 0x00; //Prescale
HWREG(WTIMER2_BASE + TIMER_O_TAILR) = 5000; //Load Value
HWREG(WTIMER2_BASE + TIMER_O_TAMATCHR) = 2500; // PWM Duty
HWREG(WTIMER2_BASE + TIMER_O_CTL) |= 0x01; //Timer enable

First, I'm not good at English. Sorry.

I'm using this setting  and PWM signal is generated at PD0.

PWM signal is generatde very well. period, duty and so on...

but it didn't work PWM interrupt.

TM4C1231H6PZ  have no PWM Generator interrupt vector.

How can I use PWM interrupt  in TM4C1231H6PZ???

  • Hello Seonhwan,

    The interrupt is generated when the Interrupt Mask bit is set in the GPTMIMR for the corresponding interrupt source using the TimerIntEnable. This allows the interrupt to be generated for the CPU.

    The generated interrupt has to be enabled in the NVIC so that it can be processed by the CPU. For this use the API IntEnable(INT_WTIMER0A)

    Also the startup_ccs.c file should have the Interrupt Handler mapped in the Interrupt Table

    Regards

    Amit

  • You/I know your meaning of, "IM" - this first time poster may not.

    Being so close - so involved w/"the action" - great effort must be made to adapt your advanced understanding/familiarity to that of those, "less involved."  (i.e. "all others!" - certainement moi)