I am using lm4f120. I set the timer0 to capture a input signal. I set a load value and match value, but it can not get into the interrupt even when I enabled the timer int and int master...
the code is below:
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); //Config the timer TimerConfigure(TIMER0_BASE, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_CAP_COUNT); //Config B6 as T0CCP0 GPIOPinConfigure(GPIO_PB6_T0CCP0); GPIOPinTypeTimer(GPIO_PORTB_BASE, GPIO_PIN_6); //Event ctl TimerControlEvent(TIMER0_BASE, TIMER_A, TIMER_EVENT_NEG_EDGE); //Load set TimerLoadSet(TIMER0_BASE, TIMER_A, 99); TimerMatchSet(TIMER0_BASE, TIMER_A, 50); //Timer int enable TimerIntRegister(TIMER0_BASE, TIMER_A, left); TimerIntEnable(TIMER0_BASE, TIMER_CAPA_MATCH); IntEnable(INT_TIMER0A); IntMasterEnable(); //TimerIntRegister(TIMER1_BASE, TIMER_B, LightLed); //Timer enable TimerEnable(TIMER0_BASE, TIMER_A);
left is the int function i wrote.