RTX 51
RTX 51
RTX 51
RTX51 About RTX51 RTX51 Full RTX51 Tiny Specifications CAN Support RTX51 FAQ How to Place an Order Why Buy Tools from Us? Information Request Get a Quote
Copyright 1996-1999 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.
RTX51 Full
RTX51 Full
While embedded applications solve different real-world problems, many software developers are confronted with two fundamental problems: An operation must be executed within a relatively short time frame and must have a guaranteed response time. In other words, it must be a real-time operation. Several operations are time-dependent and/or logic-dependent and must execute simultaneously (multitasking). These operations may be organized as independent computer processes that are usually referred to as tasks. The RTX51 Real-Time Operating System combines a kernel library with the task definition syntax built into the Keil C51 Compiler to provide a simple, effective method to solve these problems. While it is quite possible for an application programmer to implement the features found in a commercial real-time kernel, RTX51 saves time and effort and provides a tested, proven real-time interface.
RTX51 Full
Copyright 1996-1999 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.
Advantages of RTX51
Ease of Use
RTX51 is easy to use because all of its features are tightly coupled with the Keil C51 C Compiler. C51 provides an extended function declaration syntax for defining tasks. The following function declaration shows how easy it is to declare tasks in C. void func (void) _task_ task_number [_priority_ priority] [using register_bank]
Copyright 1996-1999 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.
System Calls
System Calls
In addition to declaring tasks, RTX51 supports a number of system calls you may use. The system calls are implemented as a library of C-callable function you use to manage and control your application and its RTX tasks.
Copyright 1996-1999 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.
Copyright 1996-1999 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.
Task Switching
Task Switching
RTX51 recognizes four task states: Ready, Running, Blocked, and Sleeping. A task may be in one and only one of these states at any given time. Task State
Ready Running (Active) Blocked (Waiting) Sleeping
Description
All tasks that a not blocked or running and that are ready to run are ready. Only one task is running. This is the task that is currently being executed by the CPU. A blocked task is a task that is waiting for an event like a time-out, message, semaphore, or a signal. Any task which has been declared but which has not started is a sleeping task. Tasks that have run but have terminated are in the sleeping state.
The ready, running, and blocked states are considered to be active states since tasks of these states were started by the user program. The sleeping state is an inactive state since tasks of this state either have not been started or have been terminated. The following directed graph illustrates how tasks may transition from state to state.
Transition Description 1 2 3
A task in the ready state is selected for execution. RTX51 changes the tasks state to running and resumes execution of the task. The previously running task is switched to the blocked or ready state. A task in the running state is changed to ready. This typically occurs when a higher priority task is ready to run. A task in the blocked state is changed to the ready state. When a task is waiting for an event (signal, time-out, message, or semaphore) it is in the blocked state. When the event occurs, the task may be switched to the ready state.
Task Switching
4 5
A task in the blocked state is changed to the running state. A task is waiting for an event is in the blocked state. When the event occurs, the task may be switched to the running state if it has a higher priority than the current running task. A task in the running state is changed to the blocked state. This occurs when a task calls os_wait to wait for an event that has not yet occurred.
By default, RTX51 performs preemptive multitasking using an event-driven task switching scheme with priorities. Basically, the task with the highest priority that is ready gets to run. You may enable a time-slice task switching scheme otherwise known as round-robin multitasking. In round-robin, a task executes for a predetermined amount of time. The kernel then switches to another task, of the same priority level, for the same time-slice, and so on. RTX51 recognizes 4 user task priority levels.
Copyright 1996-1999 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.
Event Handling
Event Handling
A task may wait for various events to occur without using any CPU time. While one task is waiting for an event, other tasks that are ready may run. Events that a task can wait for may be: Receipt of a message, A signal, An interrupt, A semaphore, An interval, A time-out, Any combination of the above. Tasks wait for these events using the os_wait system call. The following forms of waiting are supported by RTX51. Method
Normal Conditional Normal with Time-Out
Description
The waiting or blocked task may be blocked for an arbitrary amount of time until the corresponding event occurs. The waiting task is never blocked. The task can evaluate if the event occurred by using the return value from os_wait. The task is blocked until the event occurs or until the specified time limit is exceeded. This is useful when waiting for infrequent events or when an error-recovery time-out is necessary.
You may combine any of the following events in the os_wait system call. 1. wait for a message from a mailbox 2. wait for an interrupt 3. wait for a signal 4. wait for a time-out 5. wait for end of interval 6. wait for a token from a semaphore Combining events in the os_wait system call can keep program structure simple. For example, if a task needs a resource that is controlled by a semaphore and it needs to check a mailbox and it periodically must update a register (using the interval event), a single os_wait call may be used to check all of these events at once. If one of them has already occurred, RTX51 immediately returns control to the task along with the proper status. If one of the events has not occurred, the task is blocked until one does occur. Then, the task is ready for execution again.
Copyright 1996-1999 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.
Interrupt System
Interrupt System
RTX51 synchronizes tasks with external events using the CPU's interrupt system. Two types of interrupt processing are basically supported in this case: 1. C51 Interrupt Functions Interrupts are processed by C interrupt functions. They may exchange signals and data with RTX51 tasks. 2. Task Interrupts Interrupts are processed by fast or standard tasks of RTX51. The method of interrupt processing may be selected depending on the application. The individual methods may also be combined in a single application.
Copyright 1996-1999 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.
Time Management
Time Management
RTX51 maintains an internal time counter that measures the relative time passed since the system was started. The physical source of the time-base is an interrupt from one of the CPU's on-chip hardware timers. The time that passes between timer-tick interrupts is called a system time slice or a system tick. The hardware timer used and the time between interrupts are both user-configurable. The counter supports time-dependent services such as Pausing a task, Time-outs while waiting for semaphores, messages, or signals, Cyclic task activation, Time-out checks in polling loops, Simple task delays.
Copyright 1996-1999 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.
Memory Management
Copyright 1996-1999 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.
Exception Handling
Exception Handling
Exception handling is one of the most important aspects of a real-time computer system. It is vital that the system is able to detect, isolate, identify, and correct abnormal conditions that occur during the execution of any task. This is especially true in systems with time-critical requirements or other aspects that make it imperative to maintain control. RTX51 supports different approaches of error handling in a real-time application. In-line error handling by examining system call return status (local). Common error handling for all tasks (system wide). Separate error handling for each task (per task). Combinations of any or all three above mentioned methods. RTX51 system calls validate parameters and catch most invalid values before they can crash the system.
Copyright 1996-1999 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.
CAN Interface
CAN Interface
RTX51 supports the Controller Area Network (CAN) controller built into the Intel 82526 and 82527; Philips 82C200, 8xC592, and 8xC598; and the Siemens 81C90, 81C91, C505C, and C515C. Using the CAN interface built-in to RTX51, you can easily implement multi-processor systems using any combination of 8051 and 166 CPUs.
Copyright 1996-1999 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.
RTX51 Specifications
RTX51 Specifications
There are two versions of RTX51: RTX51 Full (part number FR51) and RTX51 Tiny (part number TR51). Both kernels help you create applications with multiple tasks.
Multitasking
Round Robin Multitasking Preemptive Multitasking Cooperative Multitasking
FR51
RTX51 Full
TR51
RTX51 Tiny
Events
Timeouts Intervals Signals Messages Binary Semaphores Memory Pools
FR51
RTX51 Full
TR51
RTX51 Tiny
Parametric Specifications
Maximum Number of Tasks Maximum Active Tasks CODE Space Required DATA Space Required Stack (IDATA) Space Required XDATA Space Required Timer Used System Clock Divisor
FR51
RTX51 Full 256 19 6-8 Kbytes 40-46 Bytes 20-200 Bytes 650 Bytes minimum 0, 1, or 2 1,000-40,000 cycles
TR51
RTX51 Tiny 16 16 900 Bytes 7 Bytes 3 Bytes for each task
0 1,000-65,535 cycles
RTX51 Specifications
Interrupt Latency Context Switch Time (Fast Task) (depends on stack load) Context Switch Time (Standard Task) (depends on stack load) Task Priority Levels Semaphores Mailboxes Mailbox Size Memory Pools
< 50 cycles 70-100 cycles 180-700 cycles 4 8 maximum 8 maximum 8 entries 16 maximum
< 20 cycles
100-700 cycles
Other Features
Code Banking Support CAN Support (for the Intel 82526 and 82527; Philips 82C200 and 8xC592; Siemens 81C90, 81C91, C505C, and C515C)
FR51
RTX51 Full
TR51
RTX51 Tiny
Copyright 1996-1999 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.
About
Keil Software development tools for the 8051 support every level of developer from the professional applications engineer to the student just learning about embedded software development. We provide C Compilers, Macro Assemblers, Debuggers, Real-time Kernels, and Single-board Computers.
The following table shows our Products (across the top) and the Components that are included (along the left side). You may use this information to find the development tool kit that best fits your needs.
8051 Tools About C51 Demo Tools Evaluation Boards C51 FAQ How to Get Support Latest Versions RTX51 RTOS C51 Updates How to Place an Order Why Buy Tools from Us? Information Request Get a Quote
Part Number
Development Tools Vision IDE A51 Macro Assembler BL51 Code Banking Linker OH51 Object-HEX Converter C51 ANSI C Compiler OC51 Banked Object Converter dScope Simulator/Debugger MON51 Target Monitor
See Also
Keil C251 Development Tools Keil C166 Development Tools Keil Real-time Operating Systems PC-Lint Diagnostic Tool Training Courses
Copyright 1996-1999 Keil Software, Inc. All rights reserved. Report any problems to the webmaster.