Embedded system

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Picture of the internals of an ADSL modem/router. A modern example of an embedded system. Labelled parts include a microprocessor (4), RAM (6), and flash memory (7).

An Embedded system is a computer that has been built to solve only a few very specific problems and is not easily changed.[1] In contrast, a general-purpose computer can do many different jobs, and can be changed at any time with new programs for new jobs. An embedded system usually does not look like a computer, often there is no keyboard or monitor or mouse. But like any computer it has a processor and software, input and output.

The word embedded means it is built into the system. It is a permanent part in a bigger system. For example, a controller is embedded in an elevator and tells the motor to move the elevator to different floors based on buttons that are pushed. A decoder is embedded in a satellite television set-top box to read a signal from the dish and send something that a TV understands. Often this type of system must do its work in a specific amount of time. This is called real-time computing. If a set-top box got interrupted to do another task, you would see a bad picture on the TV, for example. A general purpose computer will quite often have short pauses while it does something else, it is not real-time.

Because many embedded systems are built to only perform a few very specific tasks they often do not need a full operating system. Some embedded systems use specially-built small and simple operating systems that start very quickly, others do not need one at all. Embedded systems are not adapted as easily, but they are built to perform their tasks much more reliably. Because the hardware is simpler, it is also often cheaper to build and runs faster.

In contrast to this, a general-purpose computer needs to be ready for new device drivers and software to run hardware it doesn't know about yet, like new printers or hard drives. It needs to run different application programs.

Embedded systems control many of the common devices in use today, from card readers in hotel door locks to many controls in a car. They can be small like an MP3 player or a digital camera, to large systems like traffic lights, airplane controls, or assembly line controllers in a factory.

In general, "embedded system" is not an exact term, as some systems have parts of both worlds. For example, tablets are like an embedded system because they may have a special operating system and hardware, and usually they cannot be opened and new parts added. But they are not truly embedded systems, because they are not built into another machine. They allow new applications to be loaded and some peripherals (outside equipment, like a keyboard or USB stick) to be connected. In this way they are like general-purpose computers.

Examples of embedded systems[change | change source]

Embedded systems are used everywhere in modern life and there are many examples of their use, including:

Common Features of an Embedded System[change | change source]

  • Embedded systems are designed to do a specific task, unlike general-purpose computers.
  • It does not look like a computer - there may not be a full monitor or a keyboard
  • Many embedded systems must be able to do things in real-time - in a short amount of time (almost instantly from a human view).
  • Many embedded systems must be very safe and reliable, especially for medical devices or avionics controlling airplanes.
  • Starts very quickly. People don't want to wait a minute or two for their car to start or emergency equipment to start.
  • It uses a special operating system (or sometimes a very small home-made OS) that helps meet these requirements called a real-time operating system, or RTOS.
  • The program instructions written for embedded systems are referred to as firmware, and are stored in read-only memory or flash memory chips. They run with limited computer hardware resources: little memory, small or non-existent keyboard and/or screen.

Embedded systems are not always standalone devices. Sometimes they are built as a set, like the various parts of a car - the radio, the throttle control, the pollution control, etc.[2] Sometimes they can communicate to the internet or a cell-phone network and they may have a USB reader or other connections.

User interfaces[change | change source]

An example of a user interface with buttons and a simple LCD display.

Embedded systems range from no user interface at all — only sending and receiving electric signals — to a full graphical user interfaces like on a modern computer. Quite often they will have a few buttons and a small display and some LEDs. A more complex system may have a touch screen, allowing the meaning of the buttons to change with each screen as in smart phones.

Hardware[change | change source]

Hardware includes the chips, wires, circuit boards, buttons and displays.

CPUs[change | change source]

The most important chip is the central processing unit or CPU. This runs the software instructions. It can be a standard microprocessor or a microcontroller. Microcontrollers include the microprocessor as well as simple peripheral equipment so the system can be smaller and cheaper. They have less flexibility because those parts cannot be changed. Usually these parts include Flash memory and support for serial ports, USB, etc.

Unlike a microprocessor for a general-purpose computer, bigger and faster is not always better. Many embedded processors are very small. Sometimes this is to use less space or less power, sometimes it is to be cheaper. General-purpose computers will use microprocessors that read 32-bit or 64-bit words and run at speeds measured in GHz, but embedded processors are usually 4 to 32 bits and run at speeds usually measured in tens of MHz (a hundred times slower). (But the programs are also smaller and do not check for things that are not used).

Ready made computer boards[change | change source]

Soekris net4801, an embedded system targeted at network applications.

There are "ready-made" computer boards that can be used in some embedded systems. These often use Windows CE, Linux, NetBSD, or an embedded real-time operating system.

Sometimes it may be easier to use a circuit board that is already made. These usually share many components with general purpose computers, but are smaller than one in a general purpose computer. Boards such as the VIA EPIA can run Microsoft Windows. The advantage is that it saves some electrical engineering time and can use the same software development tools used for PC-type software development. Examples of such embedded devices are the ATMs or displays in casinos. This works well if the real-time requirements are not real strict (it doesn't matter much if a job takes eight seconds instead of five, for example).

ASIC and FPGA solutions[change | change source]

If the device needs to be very small or will be sold in very big numbers ("high-volume"), it makes sense to make a custom or specialized chip that does exactly what is needed. This is a system on a chip (SoC) which holds a complete system - processor, floating point unit, memory cache and interfaces on a single integrated circuit. SoCs can be made as a special-order application-specific integrated circuit (ASIC) or by using a field-programmable gate array (FPGA) which is programmed by the people building the embedded system.

Peripherals[change | change source]

Embedded systems talk with the outside world or other components using peripherals such as:

Software[change | change source]

Operating Systems[change | change source]

As embedded systems get bigger, things that used to be only on general-purpose computers or even mainframes are now becoming common on embedded systems. This includes protected memory space, and open programming environment including Linux, NetBSD, etc.

Some examples of operating systems, from simple to complex:

  • Simple control loop - A timer and a loop is used to call different subroutines repeatedly. This is often made by one person for smaller systems.
  • interrupt controlled - The tasks are started by different kinds of events. The event could be something timed (every ten seconds, for example) or by a button press or data received.
  • nonpreemptive multitasking - Each task gets its turn to run, and when it finishes it calls a scheduler in the OS to run the next task.
  • preemptive multitasking or multi-threading - A task can be stopped after some amount of time to let another task run for a while. No task can hog the system. At this level the system is considered to have an "operating system" kernel and can run tasks in parallel. This type of OS is usually bought from a company that only works on embedded operating systems.

Real-time operating systems include products like MicroC/OS-II, Green Hills INTEGRITY, QNX or VxWorks. Unlike MacOS or Windows 7, these operating systems are not known very well by most people. But they are used in many places where time and safety is very important. People use them every day and do not realize it.

Common examples of larger kernels are Embedded Linux and Windows CE. Although these do not have the tight time limits needed for a strict real-time system, they are becoming more common, especially for more powerful devices such as Wireless Routers and GPSs. They allow re-use of code in the public domain for Device Drivers, Web Servers, Firewalls, and other code. Software developers that are more comfortable writing applications for PCs will find this more familiar as well. If needed, an FPGA or other special hardware can be used for things that do need tight time limits.

Tools[change | change source]

Like other software, embedded system designers use compilers, assemblers, and debuggers to develop embedded system software. However, they may also use some more specific tools:

  • For systems using digital signal processing, developers may use a math tools such as MATLAB, MathCad, or Mathematica.
  • Custom compilers and linkers may be used to improve optimisation for the particular hardware.
  • An embedded system may have its own special language or design tool, or add enhancements to an existing language like the one used by Basic Stamp.

Debugging tools:

  • An in-circuit debugger (ICD), a hardware device that connects to the microprocessor via a JTAG interface. This starts and stops the microprocessor from outside as it runs the software. It also allows memory and registers to be read, and to store the software program in memory.
  • External debugging using logging or serial port output to trace operation using either a flashing monitor (printfs).
  • Interactive resident debugging - if the OS supports it, this is a shell on the embedded processor that runs commands typed by the developer (Linux, for example).
  • An in-circuit emulator replaces the microprocessor on the board, providing full control over everything the microprocessor could do.
  • A complete emulator simulates all the features of the hardware, allowing all of it to be controlled and modified. The hardware doesn't really exist, but a pretend version of it (a "virtual" machine) is on a normal PC.
  • Checking external lines with a logic analyzer or multimeter.

Unless restricted to external debugging, the programmer can typically load and run software through the tools, view the code running in the processor, and start or stop its operation. The view of the code may be as assembly code or source-code. Some integrated systems (like VxWorks or Green Hills) have special features, like keeping track of how much space the software takes as it runs, what tasks are running, and when things happen.

Depending on what kind of embedded system is being made will affect how it can be debugged. For instance, debugging a single microprocessor system is different from debugging a system where processing is also done on a peripheral (DSP, FPGA, co-processor).

Safety and Reliability[change | change source]

Embedded systems are often in machines that are expected to run for years without errors, and in some cases recover by themselves if an error occurs. This means the software is usually developed and tested more carefully than that for personal computers, and unreliable mechanical moving parts such as disk drives and fans are avoided.

Places where safety and reliability are important:

  • Some systems cannot safely be shut down for repair, or it is too difficult to repair. Examples include space systems (satellites, rovers), under-sea cables, and nuclear power plant controls.
  • The system could kill people if it fails, such as aircraft controls, chemical factory controls, train signals, and heart defibrillators.
  • The system will lose large amounts of money if it is shut down or if a mistake is made: Telephone switches, factory controls, cash registers, automated teller machines.

Ways to recover from errors — both software bugs such as memory leaks, and also soft errors in the hardware:

  • Watchdog timer that restarts the embedded system if something stops working.
  • Duplicate parts, where one system can take over if another one stops working.
  • Software "limp modes" that provide partial function.
  • Immunity Aware Programming

Other pages[change | change source]

References[change | change source]

Further reading[change | change source]

Other websites[change | change source]