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/TM4C1230H6PM: How to use a clock function to run several threads?

Part Number: TM4C1230H6PM

Tool/software: TI-RTOS

Use the BIOS Clock Function - I am trying to use a clock function to run several different threads.   (Fxn 1 runs every 2 ticks, Fnx 2 runs every 10 ticks, Fxn 3 runs every 14 ticks).  I thought about using the clock getTicks()  function call to retrieve the number of ticks and them perfoming a modulus operation on the returm value of the getTicks() call to  determine what Swi to post.  Not sure if this is  a proper approach.  Could anyone please point me in the rightr direction?  Thanks, in advance.

  • Hi Manuel,

     I think it is better to let the TI-RTOS handle the different functions at different ticks based on a common timebase. For example, you would set up a clock module with a timebase of 0.1s and specify the number of ticks (2, 10 and 14) for the three functions. When a tick goes off, the clock Swi is posted to run at the priority specified by the user. When this Swi runs, it will figure out which clock functions need to be run ad then call them when their interval is reach.

     Below is an example on how to configure the clock module and clock functions statically. You will see that a clock module with a timebase of 0.1s is created and there are three ledToggle functions that will be called at  ticks, 10 ticks and 14 ticks.

    I will suggest you go through the TI-RTOS training especially series 7 where the clock module/functions are presented that addresses exactly what you are looking for. Please go to the wiki page where the example code is also provided. 

  • Charles,

    Thanks for the example screens and the link to the 2-day workshop.  Your information was very informitive and useful.  

    Regards,

    Manny