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.

lm4f120h5qr Wide Timer Input Time Capture problem

Hi,

I'm using the LM4F120 launch pad, and I would like to use one of the wide timer's input time capture functionality to measure the widht of an PWM signal. My problem is that, the code which works on an regual timer (ie.: TIMER3) it doesn't work with the WTIMER0.

The code is the following:

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
GPIOPinConfigure(GPIO_PC4_WT0CCP0);
GPIOPinTypeGPIOInput(GPIO_PORTC_BASE, GPIO_PIN_4);
GPIOPinTypeTimer(GPIO_PORTC_BASE, GPIO_PIN_4);

SysCtlPeripheralEnable(SYSCTL_PERIPH_WTIMER0);

WTIMER0_CTL_R = WTIMER0_CTL_R & (~TIMER_CTL_TAEN);

WTIMER0_CFG_R = 0x04;
WTIMER0_TAMR_R = TIMER_TAMR_TACMR | 0x03;
WTIMER0_CTL_R = TIMER_CTL_TAEVENT_BOTH;
WTIMER0_TAPR_R = 100;
WTIMER0_IMR_R = TIMER_IMR_CAEIM;
WTIMER0_CTL_R|= TIMER_CTL_TAEN;

IntEnable(INT_WTIMER0A);

The interrupt table filled correctly, and if I would change the WTIMER0 to TIMER3 it would work. I also checked, that PWM signal signal appears on the external pin, so I assume that it appears also on the IC's pin (to be sure I'll check it too, because I have no other idea what is the problem currently...)

Thx for the help!