设置了一个5S的定时器,主循环设为空闲进入电源管理。mcu没有降低功耗。
GPTimerCC26XX_Params timeParams;
GPTimerCC26XX_Params_init(&timeParams);
timeParams.width = GPT_CONFIG_32BIT;
timeParams.mode = GPT_MODE_PERIODIC_UP;
timeParams.matchTiming = GPTimerCC26XX_SET_MATCH_NEXT_CLOCK;
timeParams.direction = GPTimerCC26XX_DIRECTION_UP;
timeParams.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF;
gptime = GPTimerCC26XX_open(CC1310_LAUNCHXL_GPTIMER0A,&timeParams);
ClockP_FreqHz freq;
ClockP_getCpuFreq(&freq);
GPTimerCC26XX_Value loadVal = freq.lo *5 – 1; //5s
GPTimerCC26XX_setLoadValue(gptime, loadVal);
GPTimerCC26XX_registerInterrupt(gptime,interruptTimer_5s,GPT_INT_TIMEOUT);
GPTimerCC26XX_start(gptime);
while(1)
{
bool previousHwiState = IntMasterDisable();
IntMasterEnable();
Power_idleFunc();
IntMasterDisable();
if(!previousHwiState)
{
IntMasterEnable();
}
};
请问我要如何设置这个定时器,还是如配置电源方式
Viki Shi:
请参考这边:dev.ti.com/…/GPTimerCC26XX.html
user6056718:
回复 Viki Shi:
你好,说明里我没看到有低功耗运行定时器,能否帮忙指出下。
Viki Shi:
回复 user6056718:
After GPTimerCC26XX_start(): The device will only go to Idle power mode since the high-frequency clock is needed for timer operation.
定时器使用需要时钟运行,不能进入低功耗
user6056718:
回复 Viki Shi:
哪如何进入空闲电源模式
Viki Shi:
回复 user6056718:
TI RTOS本身会管理设备的功耗状态,以使设备获得最低功耗。具体操作请参考TRM第六章:
www.ti.com/…/swcu117h.pdf
user6056718:
回复 Viki Shi:
在no rtos中如何进入。