circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

December 1998, Issue 101

A Minimalist Multitasking Executive


by Richard Man & Christina Willrich
Start Task Function Scheduling and Timeslice Task Context Task Control Block Global Variables Memory Management API Assembly Functions Give it a Try Enhancements References, Sources & PDF

ENHANCEMENTS

In summary, µexec is a small, simple to use, simple to port, and yet useful multitasking executive. Its resource usage is modest, taking only about 700 bytes on an ’HC11.

With this executive, even simple embedded programs can be written as multiple tasks, gaining you the benefit of having a preemptive executive.

Naturally, there are plenty of possible enhancements, such as adding the watchdog timer function that comes with most microcontrollers to the system. As well, you might choose to modify the system so that error conditions can be reported via your system’s output mechanisms (serial port, LCD, or even just a blinking LED).

Or, why not modify the system so that it prints out the maximum stack usage for each task? You can even add a name field to the task control block so that diagnostics can be printed with the task’s name.


Richard Man and Christina Willrich are the owners of ImageCraft, a company which specializes in low-cost professional ANSI C tools for microcontrollers, plus ’HC12 hardware and BDM debug Pods. You may contact them via
www.imagecraft.com.