TI中文支持网
TI专业的中文技术问题搜集分享网站

CC2640R2F: CC2640R2F定时器使用边沿计时模式,怎么设置成24位的定时器,默认的16位计时器计时时间太短了

Part Number:CC2640R2F

GPTimerCC26XX_Params params;
GPTimerCC26XX_Params_init(&params);
params.width = GPT_CONFIG_16BIT;//默认是16位的,我看手册里面可以设置成24位模式,怎么设置成24位模式呢?
params.mode = GPT_MODE_EDGE_TIME_UP;
params.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF;

hTimer = GPTimerCC26XX_open(Board_GPTIMER0A, &params);
if(hTimer == NULL) {
//Log_error0("Failed to open GPTimer");
//Task_exit();
}

GPTimerCC26XX_PinMux pinMux = GPTimerCC26XX_getPinMux(hTimer);
PINCC26XX_setMux(PinMyHandle, IOID_11, pinMux);

// GPTimerCC26XX_setLoadValue(hTimer, 2400);
// GPTimerCC26XX_setMatchValue(hTimer, 1200);
GPTimerCC26XX_registerInterrupt(hTimer, timerCallback, GPT_INT_CAPTURE);

GPTimerCC26XX_disableInterrupt(hTimer, GPT_INT_CAPTURE);
GPTimerCC26XX_setCaptureEdge(hTimer, GPTimerCC26XX_BOTH_EDGES);
GPTimerCC26XX_start(hTimer);
GPTimerCC26XX_enableInterrupt(hTimer, GPT_INT_CAPTURE);

Kevin Qiu1:

风吹我衣 说:我看手册里面可以设置成24位模式,怎么设置成24位模式呢?

在16位模式下,可以通过预分频器达到16+8=24位的分辨率

The GPTimer can be used in two different configurations. In 32-bit mode the timer will act as a full-width timer and is controlled using the Timer A unit. In split (16-bit) mode the timer is split into 2x 16-bit timers. In 16-bit mode a prescaler is available for each timer unit, effectively increasing the resolution in this mode to 24-bit. All supported modes by driver in split configuration uses prescaler as timer extension.

赞(0)
未经允许不得转载:TI中文支持网 » CC2640R2F: CC2640R2F定时器使用边沿计时模式,怎么设置成24位的定时器,默认的16位计时器计时时间太短了
分享到: 更多 (0)