What is an embedded system

What is an embedded system

Embedded system generally refers to non-PC systems, computer functions but not called computer equipment or devices. It is application-centered, hardware and software can be reduced to adapt to the application of the system on the function, reliability, cost, volume, power consumption and other comprehensive and strict requirements of the special computer system. Simply put, the embedded system set of system application software and hardware in one, similar to the PC in the BIOS way of working, with small software code, a high degree of automation, fast response time and other characteristics, especially suitable for the requirements of real-time and multi-tasking system. Embedded systems are mainly composed of embedded processors, related support hardware, embedded operating systems and application software systems, which can work independently of the "device".

Embedded systems include almost all the electrical equipment in life, such as handheld PDA, mobile computing devices, TV set-top boxes, cell phones, digital TV, multimedia, automobiles, microwave ovens, digital cameras, home automation systems, elevators, air conditioning, security systems, vending machines, cellular telephones, consumer electronics, industrial automation instrumentation and medical instruments.

The hardware part of an embedded system includes the processor/microprocessor, memory and peripheral devices and I/O ports, graphics controllers, and so on. Embedded system is different from the general computer processing system, it does not have a high-capacity storage media like hard disk, and most of the use of EPROM, EEPROM or flash memory (Flash Memory) as a storage medium. The software component consists of operating system software (requiring real-time and multitasking operation) and application programming. The application program controls the operation and behavior of the system; and the operating system controls the interaction between the application program and the hardware.

II Embedded Processor

The core of an embedded system is the embedded microprocessor. Embedded microprocessors generally have four characteristics: (1) strong support for real-time and multi-tasking, can complete multi-tasking and have a shorter interrupt response time, so that the internal code and the real-time operating system execution time is reduced to a minimum; (2) has a strong memory protection function, which is due to the embedded system's software structure has been modularized, and in order to avoid incorrect cross-interaction between software modules, it is necessary to avoid the software module. (3) scalable processor architecture, in order to be able to quickly expand to meet the application of high-performance embedded microprocessors; (4) embedded microprocessors must be very low power consumption, especially for portable wireless and mobile computing and communications equipment in the battery-powered embedded system (4) The power consumption of the embedded microprocessor must be very low, especially for battery-powered embedded systems in portable wireless and mobile computing and communication devices.

According to incomplete statistics, the total number of varieties of embedded processors around the world has exceeded 1,000, and there are more than 30 series of popular architectures. Among them, 8051 system accounts for more than half, the production of this microcontroller semiconductor manufacturers have more than 20, **** more than 350 kinds of derivatives, only Philips has nearly 100 kinds. Almost every semiconductor manufacturer now produces embedded processors, and more and more companies have their own processor design departments. Embedded processors generally range from 64kB to 16MB of addressing space, with processing speeds of 0.1 to 2000MIPS, and are commonly available in packages of 8 to 144 pins.

Based on the current situation, embedded computers can be divided into the following categories.

(1) Embedded Microprocessor Unit (EMPU)

Embedded microprocessors use "enhanced" general-purpose microprocessors. Since embedded systems are often used in harsh environments, embedded microprocessors require higher operating temperatures, electromagnetic compatibility, and reliability than general-purpose standard microprocessors. However, embedded microprocessors are basically the same as standard microprocessors in terms of functionality. According to the actual embedded application requirements, the embedded microprocessor will be assembled on a specially designed motherboard, only retaining and embedded applications related to the motherboard functions, which can significantly reduce the size of the system and power consumption. Compared with industrial control computers, the system composed of embedded microprocessors has the advantages of small size, light weight, low cost and high reliability, but on its circuit board must include ROM, RAM, bus interface, various peripherals and other devices, thus reducing the reliability of the system, and technical confidentiality is poor. By the embedded microprocessor and its memory, buses, peripherals, etc., installed in a circuit board constitutes a commonly referred to as a single-board computer system. Embedded processors are currently the main Am186/88, 386EX, SC-400, Power PC, 68000, MIPS, ARM series.

(2) Embedded Microcontroller Unit (Microcontroller Unit, MCU)

Embedded microcontroller, also known as a microcontroller, which integrates the entire computer system into a chip. Embedded microcontroller is generally a microprocessor core as the core, according to some typical applications, in the chip internal integration of ROM / EPROM, RAM, bus, bus logic, timing / counter, watchdog, I / O, serial ports, pulse-width modulation output, A/D, D / A, Flash RAM, EEPROM, and other necessary functional components and peripherals. In order to adapt to different application requirements, the configuration of the function and peripherals of the configuration of the necessary modifications and cuts customized to make a series of microcontroller with a variety of derivatives, each derivative of the processor core are the same, the difference is the configuration of the memory and peripherals and the function of the setup. This allows the microcontroller to match the application requirements to the maximum extent possible, thus reducing the power consumption and cost of the whole system. Compared to embedded microprocessors, the monolithic nature of microcontrollers allows the application system to be greatly reduced in size, resulting in a significant reduction in power consumption and cost, and increased reliability. As embedded microcontrollers are currently in the product variety and number of all kinds of embedded processors in the most, and many of the above advantages determine the microcontroller is the mainstream of embedded system applications. Microcontrollers are generally richer in on-chip peripheral resources and are suitable for control, hence the name microcontroller. Usually, embedded microprocessors can be divided into general-purpose and semi-general-purpose two categories, more representative of the general-purpose series, including the 8051, P51XA, MCS-251, MCS-96/196/296, C166/167, 68300 and so on. The more representative semi-general-purpose series, such as support for the USB interface MCU 8XC930/931, C540, C541; support for I2C, CAN bus, LCD, etc., a number of specialized MCU and compatible series. Currently, MCUs account for about 70% of the embedded systems market share.

(3) Embedded DSP processor (Embedded Digital Signal Processor, EDSP

In the digital signal processing applications, a variety of digital signal processing algorithms are quite complex, the complexity of these algorithms may be O (nm), or even NP, the general structure of the processor can not be real-time completion of these operations. The general structure of the processor can not accomplish these operations in real time. Due to the special design of system structure and instructions, DSP processors are suitable for real-time digital signal processing. In digital filtering, FFT, spectral analysis, etc., DSP algorithms are entering the embedded field in large quantities, and DSP applications are transitioning from the realization of DSP functions in general-purpose microcontrollers with ordinary instructions to the use of embedded DSP processors. There are two types of embedded DSP processors: (1) DSP processors become embedded DSP processors through monolithization, EMC modification, and addition of on-chip peripherals; TI's TMS320C2000/C5000 belongs to this category; (2) DSP co-processors are added to general-purpose microcontrollers or SOCs, such as Intel's MCS-296 and Infineon's TriCore (Siemens). (2) Adding DSP coprocessors to general-purpose microcontrollers or SOCs, such as Intel's MCS-296 and Infineon's (Siemens) TriCore. In addition, embedded DPS processors are also needed in applications related to intelligence, such as various consumer products with intelligent logic, bio-information recognition terminals, keyboards with encryption and decryption algorithms, ADSL access, real-time voice compression and decompression systems, virtual reality displays, etc. These intelligent algorithms are generally computational. This kind of intelligent algorithm is generally a large amount of arithmetic, especially vector operations, pointer linear addressing and so on, and these are exactly where the advantages of DSP processors lie. Embedded DSP processor is more representative of TI's TMS320 series and Motorola's DSP56000 series. The TMS320 series processors include the C2000 series for control, the C5000 series for mobile communications, and the higher performance C6000 and C8000 series. The DSP56000 has evolved into several different families of processors including the DSP56000, DSP56100, DSP56200 and DSP56300. In addition, Philips has recently introduced the R. E. A. L DSP processor, which is based on a resettable embedded DSP architecture and manufactured using low-cost, low-power technology, featuring a dual Harvard architecture and dual multiply/accumulate units, and targeting high-volume consumer products.

(4) Embedded System On Chip (SOC)

With the promotion of EDI and the popularization of VLSI design, as well as the rapid development of semiconductor processes, it is possible to realize a more complex system on a single piece of silicon, which gives rise to SOC technology. Various general-purpose processor cores will be used as standard libraries for SOC design companies, and many other embedded system peripherals, as a standard device in VLSI design, described in standard hardware languages such as VHDL, Verlog, etc., and stored in the device library. Users only need to define their entire application system, simulation through the design can be handed over to the semiconductor factory to produce samples. In addition to some devices can not be integrated, the entire embedded system can be integrated into a chip or several chips, the application system board will become very simple, for reducing the size of the application system and power consumption, improve reliability is very favorable. SOC can be divided into two categories, general-purpose and specialized, general-purpose SOC such as Infineon (Siemens) TriCore, Motorola's M-Core, and some ARM series devices, such as Echelon and Motorola jointly developed Neuron chip, etc.; Specialized SOC is generally dedicated to a certain or a certain type of system, such as the Philips Smart XA, which is a chip that can be integrated into the embedded system. Philips Smart XA, which will XA microcontroller core and support more than 2048-bit complex RSA algorithm of the CCU unit made in a piece of silicon, forming a special SOC can be loaded with Java or C language, can be used in Internet security.

Three Embedded Operating System

Embedded operating system is a kind of operating system software to support the application of embedded systems, which is an extremely important part of the embedded system (including hard and software systems), usually including the underlying driver software related to the hardware, the system kernel, the device driver interface, communication protocols, graphical interfaces, standardization of browsers, such as Browser. Embedded operating systems have the basic features of general-purpose operating systems, such as the ability to effectively manage increasingly complex system resources; the ability to virtualize the hardware, freeing developers from the busy driver porting and maintenance; and the ability to provide libraries, drivers, tool sets, and applications. Compared with general-purpose operating systems, embedded operating systems have more prominent features in terms of system real-time efficiency, hardware dependency, software solidification, and application specificity.

1. Types of embedded operating systems

In general, embedded operating systems can be divided into two categories, one is a real-time operating system for control, communication and other fields, such as WindRiver's VxWorks, ISI's pSOS, QNX System Software's QNX, ATI's Nucleus, etc.; the other is a non-real-time operating system for consumer electronics. The other is a non-real-time operating system for consumer electronics products, which include personal digital assistants (PDAs), cell phones, set-top boxes, e-books, WebPhones, and so on.

a. Non-real-time operating systems

In the early days of embedded systems, there was no concept of an operating system, and programmers writing embedded programs were usually directly confronted with bare metal and bare devices. In this case, the embedded program is usually divided into two parts, i.e., foreground program and background program. Foreground program through the middle to deal with events, its structure is generally an infinite loop; background program is in charge of the entire embedded system software, hardware resource allocation, management and task scheduling, is a system management scheduling program. This is usually called the front and back office system. In general, the background program is also called the task level program, the foreground program is also called the event processing level program. When the program is running, the background program checks whether each task has the conditions to run, and completes the corresponding operation through a certain scheduling algorithm. For the real-time requirements of the operation is particularly strict by the interrupt to complete, only in the interrupt service program to mark the occurrence of the event, no longer do any work on the exit interrupt, after the background program scheduling, transferred to the foreground program to complete the processing of the event, so as not to cause the time-consuming event in the interrupt service program to deal with the impact of the follow-up and other interruptions.

In practice, the real-time performance of the front- and back-end systems is worse than expected. This is because the front- and back-end systems consider all tasks to have the same priority, i.e., to be equal, and tasks are queued through a FIFO queue, so that tasks with high real-time requirements cannot be processed immediately. In addition, since the foreground program is an infinite loop structure, once the task being processed in the loop body crashes, the other tasks in the entire task queue do not have the opportunity to be processed, resulting in the collapse of the entire system. This type of system is widely used in simple embedded applications because of its simple structure and little additional RAM/ROM overhead.

b. Real-Time Operating Systems

A real-time system is a computer system that can perform its functions and respond to external asynchronous events in a defined period of time. The correctness of its operations depends not only on the correctness of the logical design, but also on the time at which these operations are performed. The phrase "in a defined period of time" is at the center of this definition. In other words, real-time systems are strictly response time demanding.

Real-time systems have very strict logic and timing requirements, and deviations in logic and timing can have serious consequences. There are two types of real-time systems: soft real-time systems and hard real-time systems. The soft real-time system only requires that the event response is real-time, and does not require a limit on how long a task must be completed; while in the hard real-time system, not only requires the task response to be real-time, but also requires the completion of the event processing within the specified time. Typically, most real-time systems are a combination of both. The design of real-time application software is generally more difficult than the design of non-real-time application software. The technical key to real-time systems is how to ensure the real-time nature of the system.

A real-time multitasking operating system is an operating system that is real-time and can support the work of a real-time control system. Its primary task is to schedule all available resources to complete the real-time control tasks, followed by focusing on improving the efficiency of the computer system, the important feature is to meet the time constraints and requirements. Real-time operating system has the following functions: task management (multi-tasking and priority-based task scheduling), inter-task synchronization and communication (semaphores and mailboxes, etc.), memory optimization management (including ROM management), real-time clock services, interrupt management services. Real-time operating system has the following characteristics: small size, interrupt is blocked for a very short time, interrupt processing time is short, task switching is very fast.

Real-time operating systems can be divided into two categories: preemptible and non-preemptible. For the priority-based system, the preemptive real-time operating system means that the kernel can seize the right to use the CPU of the running task and will be given the right to use the task to enter the ready state of higher priority, is the kernel grabbed the CPU to let other tasks run. A non-preemptable real-time operating system uses an algorithm and decides to let a task run, then gives full control of the CPU to that task until it voluntarily returns control of the CPU. Interrupts are handled by the interrupt service program, which can activate a hibernating task to enter the ready state; the task in the ready state cannot be run until the currently running task voluntarily hands over control of the CPU. The real-time performance of using this type of real-time operating system is better than that of a system that does not use a real-time operating system, and its real-time performance depends on the execution time of the longest task. The disadvantage of a non-preemptable real-time operating system is precisely the same; if the execution time of the longest task cannot be determined, the real-time performance of the system cannot be determined.

Preemptable real-time operating systems have good real-time performance, and high-priority tasks can run as soon as they have the conditions to run, or enter the ready state. That is to say, except for the highest priority task, all other tasks may be interrupted at any time during operation by a task with a higher priority than it, allowing the latter to run. Task scheduling in this way ensures the real-time nature of the system, but if the tasks are not handled well by grabbing CPU control, it can produce serious consequences such as system crashes and crashes.

2. The development of embedded operating systems

Embedded operating systems have gone through four distinct phases along with the development of embedded systems.

The first stage is the stage of embedded algorithms without operating system, which is a system in the form of programmable controller with a single chip as the core, and at the same time, it has the function of matching with monitoring, servoing, and indicating devices. Most of this system is used in some highly specialized industrial control systems, generally without the support of the operating system, through the assembly language programming for direct control of the system, clear the memory at the end of the run. The main characteristics of this stage of the system are: system structure and function are relatively single, low processing efficiency, small storage capacity, almost no user interface. Because of this embedded system is easy to use, the price is very low, the previous application in the domestic industrial field is more common, but has been far from being able to adapt to the high efficiency, the need for large-capacity storage media, modern industrial control and emerging information home appliances and other areas of demand.

The second stage is based on embedded CPU, simple operating system as the core of the embedded system. The main features of this stage of the system are: a wide variety of CPUs, poor versatility; low system overhead, high efficiency; generally equipped with a system emulator, the operating system has a certain degree of compatibility and scalability; the application software is more specialized, the user interface is not friendly enough; the system is mainly used to control the system load and to monitor the operation of the application program.

The third stage is the general-purpose embedded real-time operating system stage, is the embedded operating system as the core of the embedded system. The main features of this stage of the system are: embedded operating system can run on a variety of different types of microprocessors, good compatibility; operating system kernel is small, efficient, and highly modular and scalable; with file and directory management, device support, multi-tasking, network support, graphical windows and user interfaces, etc.; with a large number of application programming interface (API), the development of application program interface (API), the development of simple; embedded application software is rich.

The fourth stage is Internet-based embedded systems, which is a rapidly evolving stage. At present, most embedded systems are still isolated from the Internet, but with the development of the Internet and Internet technology and information appliances, industrial control technology and other combinations of increasingly close, the combination of embedded devices and the Internet will represent the real future of embedded technology.

3. The necessity of using a real-time operating system

Embedded real-time operating system is more and more widely used in the current embedded applications, especially in the application of complex functions and huge system is more and more important.

First of all, embedded real-time operating systems improve the reliability of the system. In the control system, for security reasons, the system is required to at least not crash, but also have the ability to self-healing. Not only is it required to improve the reliability and anti-interference of the system in hardware design, but it should also improve the anti-interference of the system in software design, so as to minimize the security loopholes and unreliable hidden dangers. The long-standing software design of front and back office systems has caused the running program to produce abnormalities, errors, running flights, and even dead loops when it encounters strong interferences, resulting in the collapse of the system. In contrast, a real-time operating system manages a system where such interference may only cause one of several processes to be corrupted, which can be repaired by a system monitoring process running on the system. Typically, this system monitoring process is used to monitor the running status of each process, and when it encounters an abnormal situation, it takes some measures that are conducive to the stability and reliability of the system, such as clearing out the problematic tasks.

Second, it improves development efficiency and shortens the development cycle. In the embedded real-time operating system environment, the development of a complex application, usually in accordance with the principle of decoupling in software engineering to decompose the entire program into multiple task modules. The debugging and modification of each task module hardly affects other modules. Commercial software generally provides a good multi-task debugging environment. Again, the embedded real-time operating system gives full play to the multi-tasking potential of the 32-bit CPU. 32-bit CPU faster than 8, 16-bit CPU, in addition, it was designed to run multi-user, multi-tasking operating system, especially suitable for running multi-tasking real-time systems. 32-bit CPUs are designed to improve system reliability and stability, making it easier for them not to crash. For example, the CPU operating state is divided into system state and user state. Separating the system stack from the user stack and giving the CPU's running state in real time allows the user to protect the real-time kernel's operation from both hardware and software aspects in the system design. The previous front- and back-end approach would not have allowed the advantages of a 32-bit CPU to be realized.

In a sense, a computer without an operating system (bare metal) is useless. In embedded applications, only the CPU is embedded into the system, and at the same time, the operating system is embedded into the real computer embedded applications.

4. Advantages and disadvantages of real-time operating systems

The development of real-time applications in the embedded real-time operating system environment makes the design and expansion of the program easy, and does not require major changes to add new features. The application design process is greatly simplified by splitting the application into a number of independent task modules; and events with demanding real-time requirements are handled quickly and reliably. Through effective system services, embedded real-time operating systems make better use of system resources. However, the use of embedded real-time operating systems also requires additional ROM/RAM overhead, 2~5% extra CPU load, and the cost of the kernel.