Other Parts Discussed in Thread: CC2650
Hi,
if i start my GPTimer that counts a negative egde interrupt as count source, the power consumption increases 1mA.
Why does the timer consumes so much evcen when no interrups ocurred?
Here is my timer configuration:
/* Set up GPTimer 0B in edge time capture mode */
GPTimerCC26XX_Params timerParams;
GPTimerCC26XX_Params_init(&timerParams);
timerParams.mode = GPT_MODE_EDGE_COUNT_UP;//GPT_MODE_EDGE_COUNT_UP;//GPT_MODE_EDGE_TIME_UP;
timerParams.width = GPT_CONFIG_16BIT;
hTimer = GPTimerCC26XX_open(CC2650_GPTIMER0B, &timerParams);
// GPTimerCC26XX_Edge edge=
GPTimerCC26XX_setCaptureEdge(hTimer,GPTimerCC26XX_NEG_EDGE);
/* Register interrupt when capture happens */
//GPTimerCC26XX_registerInterrupt(hTimer, timerCallback, GPT_INT_CAPTURE);//GPT_INT_MATCH
/* Open pin handle and route pin to timer */
hA1171Pin_INT = PIN_open(&pinState, BoardA1171_INT_Table);
GPTimerCC26XX_PinMux pinMux = GPTimerCC26XX_getPinMux(hTimer);
PINCC26XX_setMux(hA1171Pin_INT, PIN_ID(Board_A1171_INT), pinMux);
after that i go an start the timer:
GPTimerCC26XX_start(hTimer);
Inside the GPTimerCC26XX.c in the "...._start(...)" function i have comment out the threadsafeconstrain function:
/* Set constraint to disallow standby while running */
// GPTimerCC26XXThreadsafeConstraintSet(handle);
and also on the "..._stop(...)" function:
/* Clear constraint to allow standby again */
// GPTimerCC26XXThreadsafeConstraintClr(handle);
Now it consumes 1mA less current while the timer activated and it seems like the timer is working like before too.
This is how the function looks like:
/*!
* @brief Set Standby constraint while using timer to avoid TI RTOS
* going into standby when timer is running. As constraints are
* counting, store constraint status and access atomically and only
* once per timer resource.
*/
static inline void GPTimerCC26XXThreadsafeConstraintSet(GPTimerCC26XX_Handle handle)
{
GPTimerCC26XX_Object *object = handle->object;
uint32_t key = Hwi_disable();
/* Only set if not already set */
if (object->powerConstraint[handle->timerPart])
{
Hwi_restore(key);
return;
}
object->powerConstraint[handle->timerPart] = true;
Hwi_restore(key);
Power_setConstraint(PowerCC26XX_SB_DISALLOW );
}
When activated it will consume 1mA more current. Why?
