Tool/software: Code Composer Studio
Hi,
I am trying to capture a 50 ms signal. The signal has different duty cycles. I want to record signals ON & OFF timing separately. The CC2538 has capture function. But it is not working. The interrupt is not get called. even if it is configured to do it. I am posting my code below-:
/***************************************************************************************************************************************************************/
GPIODirModeSet(GPIO_D_BASE,GPIO_PIN_0,GPIO_DIR_MODE_HW);
GPIOPinTypeTimer(GPIO_D_BASE,GPIO_PIN_0);
GPIOIntTypeSet(GPIO_D_BASE,GPIO_PIN_0,GPIO_BOTH_EDGES);
TimerConfigure(GPTIMER1_BASE, GPTIMER_CFG_A_CAP_COUNT_UP);
TimerControlEvent(GPTIMER1_BASE, GPTIMER_A, GPTIMER_EVENT_BOTH_EDGES);
TimerControlLevel(GPTIMER1_BASE,GPTIMER_A,true);
TimerControlTrigger(GPTIMER1_BASE,GPTIMER_A,true);
TimerEnable(GPTIMER1_BASE, GPTIMER_A);
TimerIntRegister(GPTIMER1_BASE,GPTIMER_A, capture);
TimerIntEnable(GPTIMER1_BASE,GPTIMER_CAPA_EVENT);
IntEnable(INT_TIMER1A);
//ISR is here-:
void capture(void)
{
static uint32_t TimevalgetA=0;
TimevalgetA = TimerValueGet(GPTIMER1_BASE, GPTIMER_A);
}
/***************************************************************************************************************************************************************/