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.

Clock Module Clock Tick and Second Conversion

Other Parts Discussed in Thread: SYSBIOS

Hi All, 

In the clock module, the default tick period = 1 ms. If we specify the clockParams.period = 5, does 5 clock tick period means 5 ms period?

I am moving my project from a ROTS called Contiki to TI-RTOS, and I would like to better understand the relationship between clock tick rate ( # of ticks per second) and crystal oscillator freq to the timer, CPU frequency. For MSP430 in contiki, the CPU frequency is 8.192MHZ,  the crystal oscillator freq to the timer is 32.768KHz, and the clock ticks per second is 128. Not sure how is 128 calculated based on though. 

Thanks for all the help in advance. 

Jianwei

  • Jianwei,

    The default is for Clock to use ti.sysbios.hal.Timer to create a timer to generate the system tick, which consists of a periodic call to Clock_tick(). Clock uses Clock.tickPeriod to create the timer.  Once you create a Clock instance, you can then use the Clock API to start and stop it.  by setting clockParams.period, you can specify how often your clock's handler function is run, so setting it to a value of 5 means that the handler will be run every 5 ticks.

    More information about this can be found in chapter 5 of the SYS/BIOS User's Guide (SPRUEX3M).