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.

RTOS/CC3220MODA: Example codes for various timers available for CC3220

Genius 3100 points
Part Number: CC3220MODA

Tool/software: TI-RTOS

Team,

I have seen Simplelink Academy video, where it mentions about various timers available for CC3220 (SysTick, GPT, Slow clock counter and Watchdog Timer). However I couldn't find any sample code for utilizing these timers. I hope the timer LED example shows the usage of GPT timer. I am looking for similar examples for other timers.

Regards

Zac 

  • Hi Zacson,

    There are various examples for understanding the timer options on the CC3220.
    For the GPT hardware timers, there is indeed the timerled example in the SDK.
    For the SysTick-based software timers, there is the clock example in the SDK.
    For the watchdog timer, there is the watchdog example in the SDK.
    For the slow clock counter, there is no specific example. You will have to look at section 15.3 of the TRM for details on how to use the slow clock.

    Regards,
    Michael
  • Thanks Michael,

    Few questions about timers.
    1. Are SysTick timers software or hardware timers ? In the SimpleLink Academy video, it is mentioned that the SysTick timer runs on system clock and will be affected by LPDS and Hibernate modes. I am a little confused on this. Can you please elaborate ?
    2. It seems like TI CC3220 uses SysTick as RTOS tick source, and hence RTOS application should not use these. It is also mentioned that Non OS application also shouldn't use these timers. Hence can we not use SysTick timers at all in our application? The examples actually uses them and it works, so are these not RTOS based applications ?
    3. For introducing a simple delay in my program (shouldn't be very accurate), which timer should I use ?
    4. Can you give some details about simple software based delay or timers ?

    Regards,
    Zac
  • Hi Zac,

    Answering your questions on timers:
    1. Systick is based on the hardware system clock. However, in LPDS and Hibernate, you disable the system clock and only keep the slow clock active. Thus, if your application enters LPDS or hibernate you will have to take into account that systick will not tick while it is disabled.
    2. With TIRTOS, it has a framework to take systick and generate software timers that are tracked based off of systick. Thus, it makes more sense to let it handle systick and just rely on the software timers. In nonOS
    3. If you are using TIRTOS, you should use the POSIX sleep() + usleep() or the TIRTOS Task_sleep() functions. This allows the scheduler to mark your delayed thread as blocked and run other lower priority tasks.
    4. Well, you can look at the clock example for a demonstration of software-based timers. As for software-based delays, the power measurement example shows you various ways of how to implement that.

    Regards,
    Michael