41081 Chapter Notes - Chapter 9: Interrupt Handler, Context Switch, Priority Queue
Chapter 9 – Utilization/Scheduling
Timer Overrun
• Programmers may have to pay attention to the execution duration of actions relative
to SynchSM periods to ensure the system utilizes a microcontroller properly.
• If the actions are longer than the tick, depending on the way the code is coded, a tick
may be missed.
• Automatically-detected incorrect execution is known as an exception, and the above
is called timer-overrun exception.
Utilization
• Utilization is a value that a programmer can compute to predict whether timer
overrun will occur. It can be defined as:
• It is normally presented as a percentage.
• If utilization is over 100%, the programmer can:
o Increase the task period, however this can result in worse system latency,
missing of some input events.
o Reduce the time for actions per tick, by writing more efficient code, splitting
a synch SM state into two, or removing some of the system functionality. This
could also be achieved by using a faster micro-controller or increasing a
irootroller’s lok frequency.
Utilization for multiple tasks
• When two or more tasks have different periods, the time window of interest for
computing utilization or determining actual microcontroller usage is the hyperperiod
of the tasks, which is the least-common-multiple.
• Timer overrun may occur if executing two tasks where the period of the first task is
shorter, causing a tick during the execution of the other task.
find more resources at oneclass.com
find more resources at oneclass.com