Page 271 - Embedded Microprocessor Systems Real World Design
P. 271
including the Atmel AVR microprocessors, Microchip 18Cxxx family, the Motorola
68HCxxx family, and the 8051. CMX-RTX provides task management and com-
munication, eventdriven architecture, and nested interrupts. It supports onchip
queues, semaphores, and onchip UARTs. It includes CMXBug, an interactive
debugger, and CMXTracker (a tool that tracks and logs RTOS operation).
CMX-RTX is compatible with C compilers from a number of vendors.
CMX-RTX is compact; on an AVR microprocessor, the full operating system takes
less than 6000 bytes of memory and has a context switch time of 188 processor
cycles. On the Motorola 68HC11, CMX-RTX takes less than 4000 bytes of memory
and has a context switch time of 115 cycles. CMX Systems also sells CMX-Tiny+,
a smaller, simpler operating system for smaller microcontrollers. CMX-RTX and
CMX-Tiny+ are both implemented as callable C modules that are linked into your
application code.
Using an RTOS on a microcontroller presents special challenges: The code space
is limited, the stack pointer may be implemented in hardware (making task stacks
impossible to implement), and the RAM is very limited. Some features are neces-
sarily limited on microcontroller implementations; for example, memory manage-
ment in CMX-RTX is limited to supplying memory blocks to tasks from a pool of
memory. Without hardware memory management features, it is impossible to
implement sophisticated protection mechanisms that are found on more sophisti-
cated processors.
Because microcontroller memories are so small, task switching using an RTOS
takes a greater proportion of the memory than it does on a larger device. CMX-
RTX requires 33 bytes of memory for each task when running on an Atmel AVR
processor. This can add up fast when you have a lot of tasks. For this reason, man-
aging the number of tasks in your architecture is more important in a micro-
controller environment than it is when using something with more memory.
If you are looking for an RTOS for your application, you will want to know a few
things about each candidate:
Does the operating system support preemptive scheduling (assuming you plan
to use it)?
What is the longest task switch time?
How long are interrupts disabled?
How much memory (ROM and RAM) does the RTOS use?
Does it function as an operating system or as callable routines linked to your
code?
Does it support hardware memory protection (if the CPU has the hardware)?
Does it include drivers for the hardware you need to use? (Very important unless
you don’t mind writing device drivers)
Does the RTOS vendor or another vendor provide an RTOS-aware debugger for
this RTOS?
252 Embedded Microprocessor Systems