This Project deals with the porting of Micro C/OS-II kernel in ARM powered microcontroller for the implementation of multitasking and time scheduling. Here a real time kernel is the software that manages the time of a micro controller to ensure that all time critical events are processed as efficiently as possible.
We have applied advanced real-time techniques software, that are intensively used in critical areas like space research and defense applications, to realize an industrial real time parameter Monitoring System. The heart of the system is a real-time kernel that uses preemptive scheduling to achieve multitasking on hardware platform. The Arm processor gets all relevant information from one source i.e. the remote terminal section. The temperature analysis data is plotted in convenient diagram in graphical LCD. The trend of all these parameters is available with a granularity of one minute.
Fig. 1: Representational Image of Multi-Tasking with the example of Juggling
In this project we are going to perform multitasking simultaneously. In Micro C/OS-II maximum number of task is 64, but here we going to perform up to 6 tasks the tasks like LED scrolling, alarm, temperatures sensor, graphical LCD, serial communication, relay are perform simultaneously.
1.1. Existing System
General-computing non-real-time operating systems are often quite non-deterministic. Their services can inject random delays into application software and thus cause slow responsiveness of an application at unexpected times. Other problems in this kind of system are single program approach (one task), power consumption problem.
1.2. Proposed System
In this paper, the proposed method is implemented on a coarse grain reconfigurable architecture with 8 and 32 processing elements. A large amount of random scenario have been simulated and the statistical results presented here clearly show real advantages of the proposed method, but also some limitations drawing the line of future works. The design of embedded systems has become more complex than ever, and the design qualities depend more on the cooperation of multidisciplinary design teams: hardware engineers and software engineers in general.
An embedded system is a special-purpose computer system designed performs one or a few dedicated functions, often with real-time computing constraint . In general, embedded system means the processors is embedded into that application. The majority of computer system in use today is embedded in other machinery, such as telephones, clocks, applications and vehicles.
An embedded system may have minimal requirement for memory and program length. Input and output devices may be discrete switches, relays or solenoids. An embedded controller may lack human-readable interface devices. For example, embedded systems usually don’t have keyboards, screen, disks, printers or other recognizable I/O devices of a personal computer.
Microcontrollers may control electric motors, relays, voltages and many read switches, variable resistors and other electronic devices. An embedded product uses either a microcontroller or microprocessors to do one task at a time .in an embedded system, there is only one application software that is typically burned into ROM. Example, printer, keyboard, video game player, etc…
1. Embedded system is designed to do some specific task, rather than a general purpose computer for multiple tasks. Some also have real-time performance constraints that must be met, for reason such as safety and usability; others may have low or no performance requirement, allowing the system hardware to be simplified to reduce cost.
2. Embedded systems are not always separate devices . Most often they are physically built-in to the devices they control.
3. The software written for the computer systems is often called firmware, and is stored in read-only memory or flash memory chips rather than disk drives. It often runs with limited computer hardware resources small or no keyboard, screen and little memory.
2.2. Real-Time Embedded Systems
In the simplest form, real-time systems can be defined as those systems that respond to external events in a timely fashion, the response time is guaranteed . We revisit this definition after presenting some examples of real-time systems.
Fig. 2: Overview of Real-Time System
External events can have synchronous or asynchronous characteristics. Responding to external events includes recognizing when an event occurs, performing the required processing as a result of the event, and outputting the necessary results within a given time constraint. Timing constraints include finish time, or both start time and finish time.
A good way to understand the relationship between real-time systems and embedded systems is to view them as two intersecting circles, as shown in. It can be seen tha0t not all embedded systems exhibit real-time behaviors nor are all real-time systems embedded. However, the two systems are not mutually exclusive, and the area in which they overlap creates the combination of systems known as real-time embedded systems.
Fig. 3: Image showing Overlapping Domains of Embedded Systems and Real-Time Systems
Knowing this fact and because we have covered the various aspects of embedded systems in the previous sections, we can now focus our attention on real-time systems.
Embedded system talk with the outside world via peripherals, such as
·Serial communication interfaces (SCI): RS-232, RS-422, RS-485 etc.
·Synchronous serial communication interfaces: 12C, JTAG, SPI, SSC, AND ESSI.
·Universal serial bus(USB)
·Networks: Ethernet, Controller Area Network, LAN Works etc.
·Timers: PLL(s) capture/compare and Time Processing Units.
·Discrete I/O: General Purpose Input/output (GPIO).
A real-time system (defined by IEEE) is a system whose correctness includes its response time as well as its functional correctness.
In other words, in a real-time system, it not only matters that the answers are correct, but it matters when the answers are produced.
A Late Answer is a Wrong Answer!
3.1.1. Real-Time Systems – Categories
1. Hard Real-Time Systems
2. Soft Real-Time Systems
Hard Real-Time Systems
Hard real-time means that the system (i.e., the entire system including OS, middleware, application, HW, communications, etc.) must be designed to GUARANTEE that response requirements are met. Hard Real-Time doesn’t mean fast execution. Examples:Electronic Engines, Automotive and Flight Control Systems, Medical Systems, Industrial Control Systems, Robotics.
Soft-Real Time Systems
Soft real-time is exactly the same as hard real-time in its infrastructure requirements, but it is not necessary for system success that EVERY time constraint be met. Example:Telecommunication Systems, Internet Video, ATM
Fig. 4: Overview of Soft Real-Time System
3.1.2. Real-Time Design Approaches
•There are two primary techniques used in real-time designs
– Super- loops
One program running
Many programs running, taking turns.
Super loops also called Foreground/Background Systems.There is a background loop that is always running anytime an ISR isn’t executing.The CPU is always busy. Small system of low complexity is generally designed as shown figure . An application consists of an infinite loop that calls modules to perform the desired operation (background). Interrupt services routine handle asynchronous events (foreground). Foreground is also called interrupt level; background is called task level. Critical operation must be performed by the ISR is ensure that they are dealt with in a timely fashion. Because of this ISR have a tendency to take longer than they should. Also, information for a background module made available by an ISR is not processed until the background routine gets its turn to execute. This is called the task level response. The worst-case task level response time depends on how long the background loop takes to executes. Because of the execution time of typical code is not constant; the time for successive passes through a portion of the loop is nondeterministic.
Fig. 5: Overview of Super-Loops
Background response time is the background execution time
§ Affected by if, for, while …
–May not be responsive enough
–Changes as you change your code
All ‘tasks’/functions () have the same priority!
–Code executes in sequence
–If an important event occurs it’s handled at the same priority as everything else!
–You may need to execute the same code often to avoid missing an event.
3.2. Introduction to RTOS
A real time operating system (RTOS) is key to many embedded systems today and, provides a software platform upon which to build applications . Not all embedded systems, however, are designed with an RTOS. Some embedded systems with relatively simple hardware or a small amount of software application code might not require an RTOS. Many embedded systems, however, with moderate-to-large software applications require some form of scheduling, and these systems require an RTOS. This chapter sets the stage for all subsequent chapters in this section. It describes the key concepts upon which most real-time operating systems are based.
3.2.1. Defining an RTOS
A real-time operating system (RTOS) is a program that schedules execution in a timely manner, manages system resources, and provides a consistent foundation for developing application code. For example, in some applications, an RTOS comprises only a kernel, which is the core supervisory software that provides minimal logic, scheduling, and resource-management algorithms.
Although many RTOSes can scale up or down to meet application requirements, this book focuses on the common element at the heart of all RTOSes-the kernel . Most RTOS kernels contain the following components:
Fig. 6: Image showing Architecture of RTOS
Scheduler-is contained within each kernel and follows a set of algorithms that determines which task executes when.
Objects-are special kernel constructs that help developers create applications for real-time embedded systems. Common kernel objects include tasks, semaphores, and message queues.
Services-are operations that the kernel performs on an object or, generally operations such as timing, interrupt handling, and resource management.
Common components in an RTOS kernel that including objects, the scheduler, and some services. This diagram is highly simplified; remember that not all RTOS kernels conform to this exact set of objects, scheduling algorithms, and services.
Fig. 7: Representational Image of RTOS Kernel
3.3. Commercial RTOSs
C/OS-II, VxWorks, pSOS System, Nucleus, Windows CE
3.4. RTOS Advantages
•Software that manages the time of a microprocessor or microcontroller
–Ensures that the most important code runs first
–Do more than one thing at the same time
–Application is broken down into multiple tasks, each handling one aspect of your application
–It’s like having multiple CPUs
•Provides valuable services to your application
–Time delays, Resource sharing.
4.1. Why we choose Micrium µC/OS-II
•Written in ANSI C
–Source code provided
–Consistent coding style
–Licensed on a per-end-product basis
•Extensive Documentation and Support
•Meets requirements of Safety-Critical Systems
•Large user base
–Used in hundreds of products all over the world
Written by Jean J. Labrosse in ANSI C .A portable, ROMable, scalable, preemptive, real-time, multitasking kernel .Used in hundreds of products since its introduction in 1992 .Certified by the FAA for use in commercial aircraft .Available in ARM Firmware Suite (AFS) .Over 90 ports for free download
4.2.1. Overview to µC/OS-II
MicroC/OS-II (commonly termed µC/OS-II or uC/OS-II), is a low-cost priority-based pre-emptive real time multitasking operating system kernel for microprocessors, written mainly in the C programming language. It is mainly intended for use in embedded systems. UC/OS-II is currently maintained by Micrium Inc. and can be licensed on as per product or product line basis. Use of the operating system is free for educational non-commercial use. Additionally, Micrium provides other middleware software products such as uC/OS-View, uC/CAN, uC/TCP-IP, uC/FS, uC/GUI, uC/MOD-BUS, uC/LCD, uC/USB (Mass Storage Device and Bulk) and a large assortment of uC/TCP-IP applications such as client software for DHCP, POP3, SNTP, FTP, TFTP, DNS, SMTP, and TTCP . Server software includes HTTP, FTP, and TFTP. PPP is also available.
To describes the design and implementation of µC/OS-II (pronounced “Micro C O S 2”), which stands for Microcontroller Operating System Version 2. µC/OS-II is based on µC/OS, The Real-Time Kernel that was first published in 1992. Thousands of people around the world are using µC/OS in all kinds of applications, such as cameras, medical instruments, musical instruments, engine controls, network adapters, highway telephone call boxes, ATM machines, industrial robots, and more. Numerous colleges and universities also have used µC/OS to teach students about real-time systems.