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.

TMS320C6678: TMS320C6678 Timer implementation

Part Number: TMS320C6678
Other Parts Discussed in Thread: SYSBIOS

Hello,

I would like to use a independent thread as a realtime timer. In my oppinion the easiest way to implement such a timer is to use a while loop for the timing of the timer. Is that a good idea? Is the execution time of the loop still the same all the time? In the final implementation I would like to change the loop-counter and therefore the timing of the timer with anaother independent thread in a hard deterministic way. This means that the timer finishes the time periode with the old setting (loop-counter) first and starts after that a new time periode with the new setting (loop-counter). So I have no unpredictable behavior of the timer during the changes of the loop-counter and therefore the timing. Is that possible? Are there any helpful hints for this? Or is there another possibility?

Thanks!

Best regards

W.JOHANNES

  • Johannes,

    There are many ways of implementing this but we need to understand what software you are using to provide appropriate guidance. Are you planning to implement this using bare-metal CSL code or using TI RTOS/SYSBIOS. You can configure a GP timer in HW in single shot mode so the timer triggers interrupt only ones per cycle and implement a loop or use it in continuous mode.

    I have attached few examples for timer that we have previously created for users to provide a starting point for your implementation.

    Timer example using CSL (bare-metal):

    4744.C6678_timer_ex_mcsdk.zip

    Hope this helps.

    Timer Example implementation using SYSBIOS:

    2313.C6678_timer_sysbios.zip

    Regards,

    Rahul