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.

CC2640R2F: GPTimer accuracy question with micro second

Part Number: CC2640R2F

Hi,

Customer is testing GPTimer accuracy with toggle GPIO. Customer expect with 320 us to toggle GPIO.

GPTimer testing result is closed to 320us +-15us. Is this normal?? Any idea about this kind of situation????

There is sample code for GPTimer driver testing.

void taskFxn(uintptr_t a0, uintptr_t a1) 

{
    GPTimerCC26XX_Params params;
    GPTimerCC26XX_Params_init(&params);
    params.width          = GPT_CONFIG_32BIT;
    params.mode           = GPT_MODE_PERIODIC;
    params.direction      = GPTimerCC26XX_DIRECTION_UP;
    params.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF;
    hTimer = GPTimerCC26XX_open(CEJ0_A10_1_2_GPTIMER0A, &params);
    if(hTimer == NULL)
    {
        Task_exit();
    }
    GPTimerCC26XX_Value loadVal = freq.lo / 3125 - 1;
    GPTimerCC26XX_setLoadValue(hTimer, loadVal);
    GPTimerCC26XX_registerInterrupt(hTimer, timerCallback, GPT_INT_TIMEOUT);

    GPTimerCC26XX_start(hTimer);

    while(1)
    {
        Task_sleep(BIOS_WAIT_FOREVER);
    }
}

 

callback function as below.

void timerCallback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask) {
     GPIO_writeDio(IOID_4,1);
     GPIO_writeDio(IOID_4,0);
 }

Austin