Tool/software: TI-RTOS
Hello,
please help me to find out why the timer interrupts stop working when i add almost any function other than the initialization.
The timer is initialized and started as following:
GPTimerCC26XX_Params params; GPTimerCC26XX_Params_init(¶ms); params.width = GPT_CONFIG_32BIT;// GPT_CONFIG_16BIT; params.mode = GPT_MODE_PERIODIC_UP; params.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF; GPTimerCC26XX_Handle hTimer = GPTimerCC26XX_open(CC1350STK_GPTIMER0A, ¶ms); xdc_runtime_Types_FreqHz freq; BIOS_getCpuFreq(&freq); GPTimerCC26XX_Value loadVal = freq.lo - 1; //47999 GPTimerCC26XX_setLoadValue(hTimer, loadVal); GPTimerCC26XX_registerInterrupt(hTimer, timerCallback, GPT_INT_MATCH);//GPT_INT_TIMEOUT GPTimerCC26XX_start(hTimer); void timerCallback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask) { // interrupt callback code goes here. Minimize processing in interrupt. GPIO_toggle(Board_GPIO_LED1); }
This snippet works correclty if nothing else added after GPTimerCC26XX_start(hTimer);
but when i add a loop, sleep or almost any function after the mentioned code it stops doing interrupts (toggeling the LED)
Also when i call the UART_write function after the first snippet or inside the callback function, the timer ceases from working!
why does this happen! the timer is already a hardware peripheral and should work independent from the rest of the code. it performs also hardware interrupts!
Thank you in advance