Keil™, An ARM® Company

RTX166 Tiny User's Guide

Optimizing

There are several things you may do to optimize your RTX166 Tiny programs.

  • If possible, disable Round-Robin task switching. Round-Robin requires 13 bytes of stack space to store the task context and all registers. This space is not required if task switching is triggered by calling an RTX166 Tiny library routine (like os_wait).
  • Use the os_wait routine instead of relying on the Round-Robin timeout to switch a task. This improves system reaction time and task response time.
  • Avoid setting the timer tick interrupt rate too fast. Setting the time-out for the timer tick to a small value increases the number of ticks per second but decreases the amount of time available for tasks (because the timer tick interrupt takes 100-300 cycles to execute). Set the time-out value high enough to minimize the effects of the timer tick interrupt handler.
  • To minimize the memory requirements of RTX166 Tiny, number your tasks sequentially beginning with 0.