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 need prescaler

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640, SYSBIOS

Hi all,

I'm working on CC2640 and I need to have a timer that reaches 2/3 minutes and then restart with no need of interrupt. I started using 32 bit timer  in periodic mode. I found that the 32bit GPtimer is set to run off the HF clock of 48MHz. So I calculated that in this case the full scale of the timer is 89 seconds, but this is not enough for me. I want that it reaches almost 150/200 seconds. Is possible to reach those values using prescaler? How can I set the prescaler for the timer?

In addition what's the difference between the functions GPTimerCC26XX_getValue and GPTimerCC26XX_getFreeRunValue? It's not clear from the comment on GPTimerCC26XX.h

Can anyone help me?

Thanks in advanced

Moniaga

 

  • Do you need a timer for such long timeouts?
    You can use a separate task with a long Task_sleep or a clock object callback (in Swi context). The time argument are in units of system ticks (10us per tick). You can represent 200s using system ticks.

    Go to ti/sysbios/knl/Clock.

  • Hi Tom,
    Thanks for your answer.
    I looked at your link, but I have some doubts.
    I'm using several different clocks for my application, but the function Clock_getTicks() that I need, it doesn't need the handle of the clock as input, so of which clock does it return tick value?

    Thank you

    Moniaga