What is an "embedded system"?

You should be asking what is an embedded system

What is an embedded system

Embedded system generally refers to non-PC systems, computer functions but not called a computer device or equipment. It is application-centered, hardware and software can be reduced to adapt to the application of the system on the function, reliability, cost, size, 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 system is mainly composed of embedded processor, related support hardware, embedded operating system and application software system, it is an independent work "device".

Embedded systems include almost all the electrical equipment in life, such as handheld PDA, mobile computing devices, TV set-top boxes, mobile Internet, digital TV, multimedia, automotive, 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 real-time operating system execution time is reduced to a minimum; (2) has a strong storage area protection function, this is due to the embedded system software structure has been modularized, and in order to avoid the wrong cross-interaction between software modules, it is necessary to avoid the software modules. (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 communication devices in the battery-powered embedded systems (4) The power consumption of the embedded microprocessor must be very low, especially for battery-powered embedded systems used 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 been more than 1,000 kinds of popular architecture of more than 30 series. 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. Because 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 microcontroller, which integrates the entire computer system into a chip. Embedded microcontrollers are generally based on some kind of 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 reductions in customization, so that a series of microcontrollers with a variety of derivatives, each derivative of the processor core are the same, the difference is the memory and peripheral configurations and 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 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 monolithicization, 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 (System On Chip, SOC)

With the promotion of EDI and the popularization of VLSI design, as well as the rapid development of semiconductor process, can be realized on a piece of silicon to a more complex system, which gives rise to SOC technology. A variety of general-purpose processor cores will be used as a standard library for SOC design companies, as well as many other embedded system peripherals, become a standard device in VLSI design, described in standard hardware languages such as VHDL, Verlog, etc., 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, it is the embedded system (including hard and software systems) is extremely important components, usually including hardware-related underlying driver software, system kernel, 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, tools, 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

Generally, 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

Early embedded systems did not have the 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., frontend program and backend 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 particularly stringent operations are usually completed by the interrupt, only in the interrupt service program to mark the occurrence of the event, no longer do any work to exit the interrupt, after the scheduling of the background program, transferred to the foreground program to complete the processing of the event, so as not to cause the time-consuming events in the interrupt service program to deal with the follow-up and other interruptions.

In reality, 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 level, i.e., to be equal, and because the execution of tasks is 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 how correctly the logic is designed, but also on the time at which those 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 those that have strict requirements for response time.

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. Soft real-time systems only require that the event response is real-time, and do not require a limit on how long a task must be completed; while in hard real-time systems, not only does the task response have to be real-time, but also requires that the processing of the event be completed within a specified period of 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 use of computer systems, 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 systems are characterized by the following features: small size, short time for interrupts to be blocked, short interrupt processing time, and fast task switching.

Real-time operating systems can be categorized into preemptible and non-preemptible types. For priority-based systems, a preemptive real-time operating system means that the kernel can preempt the CPU usage of a running task and give it to a higher-priority task that enters the ready state, and it is the kernel that preempts the CPU to allow other tasks to 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.

The real-time performance of a preemptible real-time operating system is so good that high-priority tasks can be 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

The embedded operating system has 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, servo, and indication 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, used to be more common in the domestic industrial field, 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, generality is relatively poor; the system overhead is small, 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 interfaces (APIs), 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 developing stage. At present, most of the embedded system is still isolated from the Internet, but with the development of the Internet and Internet technology and information appliances, industrial control technology and other combinations are increasingly close to the combination of embedded devices and the Internet will represent the real future of embedded technology.

3. The need to use a real-time operating system

Embedded real-time operating system in the current embedded applications used more and more widely, especially in the function of complex, large system applications appear more and more important.

First of all, embedded real-time operating system improves the reliability of the system. In the control system, for security considerations, the system is required to at least not crash, but also have the ability to self-healing. It is not only required to improve the reliability and anti-interference of the system in hardware design, but also should improve the anti-interference of the system in software design, to minimize the security loopholes and unreliable hidden trouble. 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 the case of a system managed by a real-time operating system, this 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.

Secondly, it improves the 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. If the previous front- and back-end approaches are still used, the advantages of 32-bit CPUs cannot be utilized.

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

4. Advantages and disadvantages of real-time operating systems

Developing real-time applications in an embedded real-time operating system environment makes it easy to design and expand the program, and new features can be added without major changes. 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.