Other Parts Discussed in Thread: SYSCONFIG, SIMPLELINK-CC13X2-26X2-SDK, Z-STACK
I want to call a function at 1Hz with "sleep" in between. I thought a timer was going to solve this, here's the timer:
Timer_Params_init(&timerParams);
timerParams.period = 1;
timerParams.periodUnits = Timer_PERIOD_HZ;
timerParams.timerMode = Timer_CONTINUOUS_CALLBACK;
timerParams.timerCallback = timerCallback;
timer0 = Timer_open(CONFIG_TIMER_0, &timerParams);
if (timer0 == NULL) { // failed init
while (1) {
}
}
if (Timer_start(timer0) == Timer_STATUS_ERROR) {
while (1) { // failed start
}
}
Inside mainThread(), at the bottom I have:
while (1) {
Task_sleep(100000);
}
While my timer callback works, current hovers at ~1.5mA, so the device is not sleeping. If instead, I remove the timer and just make my own callback function in the while loop, I observe power savings at ~23uA:
while (1) {
Task_sleep(100000);
loopCallback();
}
What is it about the timer that's doing this? Is it possible that it's keeping the HF crystal on? I'm using BAW resonator with LF RCOSC.

