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 clock tick for RTOS =10us with RTC?



THis is what written in the user guide. But as I can calculate the minimum resolution for RTC is 30us. So how it can be done? Is it a mistake?

  • Hi Bar,

    The RTC and RTOS tick are different.

    Best wishes
  • So I still confuse.

    As I understand the aim of the system to be in low power most of the time , that mean use the RTC as the main clock, Because the tick must run all time it should be point to the RTC as the base tick. So what is the clock the RTOS tick run on and still can be in low power?

    Regards

    Bar.

  • Bar,

    The RTC channel 0 is used as the underlying timer implementation in TIRTOS, that is correct. This is the only clock available in Standby mode so for the OS to have a clock available at all times, this is used.

    We have set the OS tick speed to 10us (10us = 1 OS clock tick) in our example config files, this is however not the same as the RTC tick speed.
    If you for example try to sleep for e.g. 10ms with Task_sleep(10 * 1000/Clock_tickPeriod ) the RTOS Timer implementation will convert this to the correct number of RTC ticks and wake up again at the correct time.

    The drawback of using a tick speed lower than the RTC tick speed is that you will not have things happening exactly at the correct time for events in the very near future (4 RTC periods if I remember correctly) and the accuracy for events happening longer into the future will have up to 30us inaccuracy.

    .:svend
  • Hi
    How can I reduce RTC ticks?