This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GPTimer Driver Resolution?.

Other Parts Discussed in Thread: CC2650

Hi,

Trying to setup a peridoic GPTimer to timeout every 20us.

Is this achievable with the GPTimer Driver?.

Following the example in the header file.

//Setup Timer
GPTimerCC26XX_Params params;
GPTimerCC26XX_Params_init(&params);
params.width = GPT_CONFIG_16BIT;
params.mode = GPT_MODE_PERIODIC_UP;
params.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF;
hTimer = GPTimerCC26XX_open(CC2650_GPTIMER0A, &params);

Types_FreqHz freq;
BIOS_getCpuFreq(&freq);
//TODO set 20us Timer
GPTimerCC26XX_Value loadVal = freq.lo / 1000 - 1; //47999
GPTimerCC26XX_setLoadValue(hTimer, loadVal);
GPTimerCC26XX_registerInterrupt(hTimer, timerCallback, GPT_INT_TIMEOUT);

Working with the 48Mhz clock = 20.8ns clock period.

This example produces a 1 sec timer. But why is the load value divided by 1000?.

How would I achieve a 20us timer?. Following the same logic I would have to pass a value less then 1 as the load value?.

Appreciate your advise.

Thanks

Tamir