Detailed analysis of the difference between embedded and microcontroller

What is a single chip microcomputer

First of all, the concept is clear, what is a single-chip microcomputer, the single-chip microcomputer is an integrated circuit chip, which uses a very large-scale integrated circuit technology to have a central processing unit CPU with data processing capability, a random access memory RAM, a read-only memory ROM, a plurality of I/O ports, and Interrupt system, timer/counter and other functions (may include display drive circuit, pulse width modulation circuit, analog multiplexer, A/D converter, etc.) integrated into a small piece of silicon Computer systems are widely used in industrial control.

From the 1980s, from the then 4-bit, 8-bit microcontroller, to the current 300M high-speed microcontroller. For example, the most classic 51 series MCU, the appearance is just a thumb-sized rectangular parallelepiped chip, a total of 40 pins, which contains the logic unit. In fact, it is also a cpu.

When I first came into contact with the MCU, I also had a question. Why is the MCU black and not a different color? Later I learned that it is a limitation of MCU materials.

For the single-chip microcomputer, in fact, one chip is all. Others such as the minimum system of the single-chip microcomputer are added to other components for the normal operation of the single-chip microcomputer, such as crystal oscillator, 5v power supply, and inductor resistance. Of course, the minimum system can only guarantee the normal operation of the microcontroller, and almost no application based on the microcontroller can be realized.

In order to make the microcontroller implement the application, other peripherals must be added. Such as buttons, led lights, led screens, buzzers, various sensors. This is also the MCU development board that many companies in the market are doing.

In summary, a single-chip microcomputer is a single module that performs functions such as arithmetic, logic control, and communication. That is, the single-chip microcomputer is really "single". The DSP chip can also be considered as a single chip microcomputer. Of course, they are very powerful, but the function is still very simple, in short, it is processing data and logic.

What is embedded
Detailed analysis of the difference between embedded and microcontroller

So what is embedded? Generally speaking, embedded refers to embedded systems. IEEE (InsTItute of Electrical and Electronics Engineers) defines embedded systems: "used to control, monitor or assist in the operation of machines and Device of equipment".

An embedded system is a specialized computer system that is part of a device or device. Typically, an embedded system is an embedded processor control board in which the control program is stored in ROM.

An embedded system is a system that combines an application, an operating system, and computer hardware. It refers to an application-centric, computer-based technology, and software and hardware can be tailored to address user functions, reliability, and cost. A dedicated computer system with special requirements for size, power consumption and usage environment.

In fact, all devices with digital interfaces, such as watches, microwave ovens, video recorders, and automobiles, use embedded systems. Some embedded systems also include an operating system, but most embedded systems implement full control from a single program. logic. This is because embedded systems are generally used for industrial control, which means that the control of peripherals is written dead, without manual intervention, and also to ensure the stability and reliability of the system.

We can often hear that the requirements of the company recruitment are embedded software engineers or embedded hardware engineers. That is to say, the embedded system includes software and hardware. In fact, if you think about it, you can understand that you have already run the system. Of course, there are software and bsp. Hardware.

That is to say, the embedded system is a combination of software and hardware. The embedded system generally recognized in China is defined as: application-centered, based on computer technology, software and hardware can be tailored to adapt to the application system for function, reliability, cost and volume. A special computer system with strict requirements such as power consumption.

Embedded hardware layer

The hardware layer includes an embedded microprocessor, memory (SDRAM, ROM, Flash, etc.), general device interface, and I/O interface (A/D, D/A, I/O, etc.). Adding a power circuit, a clock circuit and a memory circuit to an embedded processor constitutes an embedded core control module. The operating system and applications can be hardened in ROM.

The core is the microprocessor, the embedded processor and the general computer cpu are still different, the embedded microprocessor mostly works in a specific design system, such as TI or Atmel company has many different positioning processors, atmel SAM The series is specially designed for the Internet of Things, and the AVR is widely used in the industrial field due to its outstanding performance.

Embedded microprocessors come in a variety of different systems, and may have different clock frequencies and data bus widths, or integrate different peripherals and interfaces, even in the same system. According to incomplete statistics, there are more than 1000 embedded microprocessors in the world, and there are more than 30 series of architectures. The mainstream systems include ARM, MIPS, PowerPC, X86 and SH.

But unlike the global PC market, no embedded microprocessor can dominate the market. With 32-bit products, there are more than 100 embedded microprocessors. The choice of embedded microprocessor is based on the specific application.

In the embedded field, it can be said that the arm architecture processor occupies half of the country, and the arm company has become a well-known technology company, but it does not produce any processor, but only provides IP, you can see that the first-class company to do the standard. The other architectures used are sparc, powerpc, etc.

For example, arm has a variety of processor architectures, the most classic cortex series, which belongs to the ARMv7 architecture, which is the latest instruction set architecture of ARM by 2010. The ARMv7 architecture defines three distinct divisions: the "A" series for cutting-edge virtual memory-based operating systems and user applications; the "R" series for real-time systems; and the "M" series for microcontrollers.

The embedded system and the outside world need some form of general-purpose device interface, such as A/D, D/A, I/O, etc., and the peripherals realize the input/output of the microprocessor through the connection with other devices or sensors on the off-chip. Features. Each peripheral usually has a single function, and it can be used both on-chip and in a built-in chip. There are many types of peripherals, from a simple serial communication device to a very complex 802.11 wireless device.

Common device interfaces commonly used in embedded systems are A/D (A/D conversion interface), D/A (digital/analog conversion interface), I/O interface with RS-232 interface (serial communication interface), Ethernet ( Ethernet interface), USB (Universal Serial Bus Interface), audio interface, VGA video output interface, I2C (fieldbus), SPI (serial peripheral interface) and IrDA (infrared interface). This is actually similar to a microcontroller.

Embedded software layer

That is the operating system, including the kernel and file system, and the more top-level applications, embedded operating systems are generally Linux or other Unix-like, and some real-time operating systems (RTOS) such as VxWorks, RTEMS, ucOS Wait.

Linux also includes different distribuTIon, such as Ubuntu, Redhat, Debian, centos, etc. They all use Linux kernel, the difference is the above software and tools, of course, do not worry too much about the standard problem, the software selected by these Linux distributions. Almost all of them are more common, such as Apache for web servers, postfix for email servers, sendmail, Samba for file servers, and so on. In addition, there are standards such as Linuxstandard base to standardize developers. Unix-like is mainly FreeBSD and Solaris.

The most commonly used real-time operating system in the embedded field is the real-time nature of the real-time operating system. The essence is the predictability of Huawei's time in the task processing, that is, the task needs to be completed within the specified time limit. The IEEE definition of real-time systems is "systems whose correctness depends not only on the logical outcome of the calculation but also on the time it takes to produce the results."

The real-time operating system has hard real-time and soft real-time. Hard real-time requirements must be completed within the specified time. This is guaranteed during the design of the operating system; soft real-time is as fast as possible according to the priority of the task. Just fine. The operating system we usually use can be turned into a real-time operating system after some changes.

The differences between real-time operating systems and Linux-based time-sharing operating systems are listed below:

(1) Multiplex. Real-time information processing systems are as multiplexed as time-sharing systems. The system serves multiple end users on a time-sharing basis. For real-time control systems, the multi-pathivity is mainly manifested in the frequent collection of multi-channel on-site information and control of multiple objects or multiple actuators.

(2) Independence. Real-time information processing systems are as independent as time-sharing systems. Each end user operates independently of each other when making a service request to the time-sharing system, and does not interfere with each other; in the real-time control system, information collection and object control do not interfere with each other.

(3) Timeliness. The real-time information system's real-time requirements are similar to those of the time-sharing system, which are determined by the waiting time that people can accept. The timeliness of the real-time control system is the start deadline or completion deadline required by the control object. To determine, generally in the second level, hundreds of milliseconds up to the millisecond level, and even some are less than 100 microseconds.

(4) Interactivity. Real-time information processing systems are interactive, but the interaction of people with the system here is limited to accessing certain specific service programs in the system. It does not provide services such as data processing services and resource sharing to end users like time-sharing systems.

(5) Reliability. Time-sharing systems require a reliable system, compared to real-time systems that require a highly reliable system. Because any mistake can bring huge economic losses or even unpredictable catastrophic consequences. Therefore, in the real-time system, multiple levels of fault tolerance measures are taken to ensure system security and data security.

Because it is more reliable and timely. Embedded real-time operating systems are more widely used in industrial control, aerospace, military and other fields, such as the RTEMS real-time operating system used by NASA NASA in recent years.

Embedded middle layer

The so-called middle layer is the interface layer between the software layer and the hardware layer, which is strictly a software layer. The general developer calls it BSP. This layer is mainly responsible for providing hardware drivers, hardware configuration operations, etc., and providing standard APIs to software developers. Developers who develop intermediate layers are often called embedded. driver engineer.

It can also be seen from this that embedded design and hard and soft are inseparable. It is necessary to master the characteristics of the underlying hardware and how to drive its work, as well as to understand the relevant knowledge of the operating system, in order to write the application of the corresponding function.

So look at whether an operating system supports a chip or a development board, as long as the source code of the corresponding chip or development board is included in the source code.

What kind of hardware should the embedded system run on?

Talking about embedded hardware or development board, I think many people have the first impression that RaspberryPi is a small computer with only credit card size. Don't look at the appearance of "small", the inner "heart" is very powerful, and the functions of video and audio are all available. All of them can be said that "the sparrow is small and complete." After the Raspberry Pi was launched, many vendors rushed to launch similar products, such as the banana pie.

There is also TI's Beagleboneblack board, which is similar in size to the Raspberry Pi. The peripherals include USBhost and USBmini and a network card interface. There is also an sd card slot and HDMI interface on the back. BBB's processors use the most popular ARMv7 instruction set in today's embedded systems. Processors that use today's widely used instruction set can be supported by more software. For example, some operating systems do not support running on the ARMv6 instruction set. For example, Ubuntu gave up support for the ARMv6 instruction set in April 2012.

Another advantage of ARMv7 versus the ARMv6 instruction set is that the actual performance of ARMv7 processors is even stronger. ARMv7 has many advantages over ARMv6, such as some significant improvements: it implements a superscalar architecture, includes SIMD operation instructions, and improves branch prediction algorithms to greatly improve certain performance.

to sum up

The above is the performance parameters of a basic embedded core board. Compared with the performance parameters of the single-chip microcomputer mentioned above, the processing power of the single-chip microcomputer is low, the main frequency is mostly in the tens of M, and the embedded dynamics are on the hundreds. The processing speed of thousands of M is still quite different. In addition, the single-chip microcomputer does not have the processing capability of the graphical interface, that is, the lack of the GPU makes it almost impossible for the single-chip microcomputer to drive the graphical interface.

The storage space of the MCU and the embedded processor are not a level. The MCU usually has only a few kilobytes of on-chip memory, and it is unlikely that the peripheral emmc will be widely added due to the limitations of peripherals. With hundreds of megabytes of RAM, such a huge difference makes it almost impossible for a microcontroller to run an operating system like an embedded processor. Even the TCP/IP protocol stack and the USB protocol stack cannot run. Some high-end microcontrollers such as ST's STM32 series It is possible to run some lightweight system os and embedded network protocol stacks, such as the IwIP protocol stack.

The rich and powerful performance of the embedded processor determines that it can complete applications that cannot be completed by other microcontrollers, such as network communication functions and video transmission processing functions. When the peripheral storage is increased, the embedded processor can easily run various Linux systems. And a graphical GUI interface.

In the development method, there is a big difference between the MCU and the embedded, that is, the difference of the compilation process. The MCU is mainly developed under the graphical interface such as Windows. Currently, there are many mature IDE tools such as keil, IAR, and CCS of ti. Set compilation, assembly, link, simulation as one, and because of the development under Windows, with a friendly user interface, developers only need to write c code, and then click the compile link button, error can also be debugged or simulated, get started Very fast.

Embedded development is generally carried out under Linux. The c code should be compiled on its own host, and then the compiled file will be burned into the development board through system image or uboot boot, due to the x86 architecture of the host processor. The code is written to run on the ARM architecture or the sparc architecture processor, so there is a cross-compilation chain installation. In addition, there is no IDE like Windows under Linux, that is, the compilation and link source code need to be completed by the developer. Generally, the GNUmake script is used to write the Makefile and the configure file. The Makefile writes how to compile the c or h file, that is, the compilation rules and the dependent files. These need to be done by the developers themselves. And the above process is completed in the terminal under Linux, which is the command line, which also adds difficulty to the embedded development.

Liquid Crystal Display For Clock

Dongguan Yijia Optoelectronics Co., Ltd. , https://www.everbestlcdlcms.com