One of the earliest decision points in embedded systems design is whether the system will require real-time computing capabilities. Real-time computing describes the ability to react to inputs and deliver the prescribed output within a constrained time frame. Devices that use real-time computing are deployed in applications where their correct functioning can make the difference between life and death.
As an example, consider the airbag in a conventional family sedan. When the vehicle stops abruptly in the case of a collision, the airbag must be deployed in a split second to be effective for passengers. This means that the embedded microcontroller which controls the airbags must detect that a collision is happening and electronically trigger the release of vehicle airbags - all in just a fraction of a second. This capability is made possible by the technology of real-time computing.
In this introduction to real-time embedded systems, we'll give a high-level overview of what these unique embedded systems are, how they're designed and classified, and why their functionality is so critical in real world applications. We'll also offer some real-time embedded systems examples.
A real-time embedded system combines the technologies of embedded systems and real-time computing. To achieve the most complete and accurate description, we begin with a deeper look at the defining features of these technologies.
Embedded systems are hardware-and-software computer systems that perform a dedicated function with a larger system or device. An embedded system typically consists of a microcontroller, also called a computer-on-a-chip. Microcontrollers are equipped with a CPU, memory (RAM and ROM), I/O ports, a communication bus, timers/counters, and DAC/ADC converters.
Embedded systems have three defining characteristics that embedded systems engineers should be aware of:
Real-time computing describes the capability of a computing system to respond to a given input within a tightly constrained time frame. In the context of embedded systems, engineers implement real-time computing by installing a special type of operating system onto the embedded device. Operating systems can be conceptualized as the bridge between embedded hardware and software. There are two basic types for embedded engineers to choose from:
Real-time embedded systems are those that incorporate a real-time operating system, ensuring that the device can respond to sensory inputs within the time constraints specified by the embedded software. Real-time embedded systems are further classified based on the type of real-time response they provide.
Real-time embedded systems combine the functionality of a real-time operating system with a microcontroller (hardware) and unique application (software) to solve a business problem. There are three types of RTOS that differ in function based on the time constraints associated with their application.
Hard RTOS - A hard RTOS is implemented when it is crucial that no deadlines are missed and all tasks are completed within the prescribed time frame. In a hard RTOS, delays in the system are strictly time-bound to ensure that deadlines are met at a 100% rate and any missed deadline is considered a system failure. Firm RTOS - In a firm RTOS, errors are occasionally permissible but there is an understanding that missed deadlines result in degraded performance of the device. A device using a firm RTOS may occasionally miss a deadline, but the application can recover as long as failures are relatively infrequent. Soft RTOS - In a soft RTOS, user experience is optimized when tasks are completed on-time but performance is not totally degraded when deadlines are missed. Consider a video game console that runs a game engine: it must schedule tasks and complete them on time for the game to run smoothly, but a little bit of lag or an occasional hiccup in performance does not necessarily ruin the experience for the player.A design pattern describes a repeatable solution to a problem that commonly occurs when designing a specific type of device. The pattern acts as a description of how an engineer can solve a specific problem, a framework taken from a solution to a similar problem. Design patterns help embedded systems engineers avoid reinventing the wheel as they develop their products, limiting their total debug time and reducing overall time-to-market.
The following design patterns are useful for engineers building real-time embedded systems:
Let's review a few short examples of real-time embedded systems - one from each of the classifications outlined above.
We've already mentioned vehicle airbags, which you may have identified as an example of a hard real-time embedded system. Remember the criteria for hard real-time: the value of the task is zero or negative when the deadline is missed. In this case, a missed deadline means that the airbag was not deployed in time to protect passengers in the collision.
A cardiac pacemaker could be an example of a soft real-time embedded system. Pace-makers control the heartbeat by sending electronic pulses to the heart when the attached electrical nodes detect cardiac arrhythmia in the patient. The electrical pulses help the patient's heart return to a normal beating pattern. While pace-makers provide a necessary and life-saving function, they can function effectively even while missing the occasional task deadline.
A manufacturing assembly line with robotic components might require a firm real-time embedded system. Imagine a machine that performs a simple task like sealing a toothpaste tube. If a task misses a deadline, the process fails and a single tube of toothpaste might be ruined - but as long as this happens infrequently and does not cause a major disruption, it is not considered a system failure.
Real-time embedded systems offer the predictability and performance that help embedded systems engineers build products that tackle real-world problems.
At Total Phase, we build the products that embedded systems developers need to change the world - development kits to help get you started, host adapters to support the product development process, and protocol analyzers to reduce debug time and help get your product to market even faster.
We're also supporting embedded systems development through our knowledge base where we offer tips and advice on real-time embedded programming and a host of other topics.