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.

Timing (stopwatch) application starting point

Other Parts Discussed in Thread: CC1350

Hello, 

i am absolutely new to TIRTOS, just getting started with it in context of the BLE stack for CC1350.

I am trying to port an application thats was originally written for MSP430 and didn't use any RTOS. It just had a timer interrupt configured that produced a tick every 1 millisecond. Inside the tick, counters got updated and timing was performed based on the value of the counters. 

What is the correct approach to fully utilize TIRTOS for something like this? Is there an easy way to setup such a tick or is there already one as part of the RTOS that one could use t count. Better yet, whats other approach would you recommend to achieve the same "stopwatch" like feature?

Thank you.

  • Hello,

    By default, TI-RTOS grabs a timer to drive it's Clock module. The Clock module drives things like Task_sleep and Semaphore_pend when a timeout is specified. By default the tick period is 1ms. You can add additional functions to be called by the kernel's Clock module. The main APIs are Clock_create() and Clock_start(). You can add periodic or one-shot Clock functions.

    The Power management software in TI-RTOS is aware of the timer that the kernel uses and suppresses interrupts as needed when the device is in lower power modes to minimize power usage.

    Since you mentioned "stopwatch"...there is also the Timestamp module in TI-RTOS. This can be used like a stopwatch via Timestamp_get32 (or get64). So if you want to measure something, call Timestamp_get32 (or get64), do the action, and then call Timestamp_get32 (or get64) again.  

    Todd

  • That sounds like it's exactly what we need. Thanks so much!