Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Periodic Tick Mode is the default configuration of µC/OS-III. Of the two modes which enable use of the time services, it is the simplest to understand and to implement. The mode relies on the use of a hardware timer, or some other timing source, which generates interrupts at a set frequency. Each interrupt advances the system time by one Tick.

Implications

Benefits

  • Easy to support.
  • The full set of timing services is available for use.
  • Round-Robin scheduling is available for this mode.Use of a fully supported.

Implications

  • The fixed-frequency interrupt source often poses a problem for applications with power constraints because the system cannot stay idle longer than the period of a single tick. The system will often be woken up when there is no work forces the system out of low-power modes, even if there is nothing to do.

System Behavior

Periodic Tick

A hardware timer configured to generate an interrupt at a rate between 10 and 1000 Hz provides the clock tick. A tick source may also be obtained by generating an interrupt from an AC power line (typically 50 or 60 Hz). In fact, you can easily derive 100 or 120 Hz by detecting zero crossings of the power line. That being said, if your product is subject to be used in regions that use both power line frequencies then you may need to have the user specify which frequency to use or, have the product automatically detect which region it’s in.

The clock tick interrupt can be viewed as the system’s heartbeat. The rate is application specific and depends on the desired resolution of this time source. However, the faster the tick rate, the higher the overhead imposed on the system.

The clock tick interrupt allows µC/OS-III to delay tasks for an integral number of clock ticks and provide timeouts when tasks are waiting for events to occur.

The clock tick interrupt must call OSTimeTick(). The pseudocode for OSTimeTick() is shown in the listing below.