Tool/software: Code Composer Studio
Hello,
Could you please tell me how the calculation for the Timer period value i.e. the value to be given to GPTimerCC26XX_setMatchValue is done?
The below is my code and I was trying to set a timer for 5s.
I understand that the clock freq of cc2652 is 48MHz. But how do I calculate the value to be set? (Here given as FFFF)
Timer_Params
GPTimerCC26XX_Handle hTimer;
/* Set up GPTimer 0B in edge time capture mode */
GPTimerCC26XX_Params timerParams;
GPTimerCC26XX_Params_init(&timerParams);
timerParams.mode = GPT_MODE_ONESHOT_UP;
timerParams.width = GPT_CONFIG_16BIT;;
hTimer = GPTimerCC26XX_open(Board_GPTIMER0A, &timerParams);
GPTimerCC26XX_setLoadValue(Board_GPTIMER0A, 0x0000);
GPTimerCC26XX_setMatchValue(Board_GPTIMER0A, 0xFFFF);
/* Register interrupt when capture happens */
GPTimerCC26XX_registerInterrupt(hTimer, timerCallback, GPT_INT_MATCH);
/* Start timer */
GPTimerCC26XX_start(hTimer);