The Love-Hate Relationship Between Embedded Systems and Microcontrollers

The Love-Hate Relationship Between Embedded Systems and Microcontrollers

The Love-Hate Relationship Between Embedded Systems and Microcontrollers

I often think about how fast the development and changes in modern society surpass many people’s understanding. As Luo Pangzi said, not keeping up with the times means paying a tax on cognition, which makes a lot of sense.

The semiconductor and IT industries are at the vortex of this change, developing even faster. If you think about the innovations in other industries (Meituan delivery, Didi ride-hailing, WeChat social networking, Taobao and JD e-commerce, and the latest innovations like new retail vending machines and autonomous vehicles), they are all essentially driven by innovations in the semiconductor industry. It all relies on having chips, along with supporting software resources and development talent, to enable innovation in these fields.

Having been involved in embedded development for many years, I often ponder the intrinsic driving forces and external rationality behind the rapid development and changes in chip and related software development technologies. What inspirations and guidance do these developments provide us? Being at the center of this vortex, how should we proceed to ensure we are not swept away by the tide of history and continuously enhance our value?

Microcontroller

The Chinese term for microcontroller corresponds to the English name ‘Single Chip Microcomputer’. Many people may wonder why we usually refer to it as MCU (Micro Control Unit). In fact, the accurate translation for MCU should be microcontroller. Nowadays, many Chinese books use this term instead of single-chip microcomputer because the term single-chip microcomputer is an old concept from many years ago. Back then, semiconductor technology was still in its infancy, and integration capabilities were poor. Often, there was one chip for the CPU, one for SRAM, and one for Flash. If interrupts were needed, there had to be a dedicated chip for handling interrupts, meaning a complete usable computer system was made up of many chips on a PCB.

So what is a microcontroller? It integrates the CPU, SRAM, Flash, and other necessary modules onto a single chip, thereby realizing a microcomputer system on one chip. Hence, it is called a Single Chip Microcomputer or microcontroller.

From this perspective, the term microcontroller has become meaningless because today’s semiconductor technology is already quite advanced. All the microcontrollers you buy today are essentially ‘single-chip microcomputers’, and there is no longer a concept of a separate ‘multi-chip microcontroller’. Moreover, modern microcontrollers not only integrate the essential components of a microcomputer like CPU, SRAM, and Flash, but most also include many internal peripherals such as Nand controllers, LCD controllers, serial communication, timers, RTCs, etc. Therefore, modern microcontrollers should actually be called SoCs (System on Chip).

The English terms are very precise. Here are several terms you can consider for their meanings: microcomputer, computer, system, microcontroller. If not strictly differentiated, these terms can often be interchangeable and used interchangeably. However, strictly speaking, each has a different reference. For example, a computer refers specifically to a desktop or laptop computer, which can be understood as a general-purpose computer that is bulky and heavy.

Of course, many years ago, computers were large and cumbersome, so the term computer referred to these machines that had a chassis, keyboard, mouse, and were generally heavy and bulky. A microcomputer, on the other hand, refers to things like microcontrollers. It is also an independent computer system with CPU, memory, and peripherals capable of running computer programs.

However, compared to a computer, it is much smaller and not general-purpose but rather specialized, hence it is called a microcomputer. The term system tends to refer to the entire system, meaning system = microcomputer + various peripherals. Simply put, when modules like serial ports and LCD controllers are integrated into the chip, the entire microcomputer becomes a system. Therefore, the term system is more meaningful and suitable for modern microcontroller chips. Nowadays, we refer to chips as SoCs, which is a more valuable name. As for microcontroller?

Many microcontroller manufacturers now refer to their microcontrollers as microcontrollers. Personally, I believe the emphasis in microcontroller lies in the term controller, meaning they want to highlight that the system integrated within the chip is a controller, skilled in control, rather than a DSP (Digital Signal Processor) that excels at computation.

Embedded Systems

The full name of embedded is embedded system, in English it is ‘Embedded System’. This indicates that embedded systems are systems. Why is it called embedded?

The term embedded refers to embedding this system (represented as a chip in hardware) into a device. For example, the chip on the board of a refrigerator is an embedded system within the refrigerator, responsible for controlling user buttons, the refrigerator’s lighting, the cooling system, etc.

It can be seen that the name embedded system is mainly named based on the organizational form of the chip when in use. Therefore, from this perspective, any chip embedded in a device can be called an embedded system.

This scope is too broad. Honestly, it is very difficult to find a system that does not belong to embedded… So I often feel that the term embedded is essentially meaningless. Fortunately, this understanding is only a broad definition of embedded, but we usually understand embedded in a narrow sense.

Narrowly speaking, embedded is meant to distinguish it from microcontrollers. We often refer to systems that do not have an MMU (Memory Management Unit) and therefore do not support virtual addresses, can only run bare metal or RTOS (such as ucos, Huawei LiteOS, RT-Thread, freertos, etc.) as microcontrollers (typical examples include STM32, NXP LPC series, and the new NXP imxRT1052 series), while systems with an MMU that can support virtual addresses and run operating systems like Linux, Vxworks, WinCE, and Android are called embedded systems.

Thus, Linux, WinCE, etc., are often referred to as embedded operating systems, and that’s how it is. If you carefully review, most people discuss microcontrollers and embedded systems from a narrow perspective, not a broad one.

Technical and Market Status of Microcontrollers

Microcontrollers are the most widely shipped type of computer. This is easy to understand because microcontrollers are used in a wide range of applications, and almost all built-in control systems in home appliances are microcontrollers. The number of these is quite astonishing. Various public facilities, factory automation equipment, etc., are also mostly controlled by microcontrollers. The number of manufacturers and types of microcontrollers is also very large, and I will list some commonly used categories below.

· 8-bit and 4-bit Microcontrollers.This type of microcontroller has low performance and low configuration, but the advantage is that it is cheap. Therefore, many low-end home appliance products will use this type of microcontroller, and small appliances are the largest market for this type of microcontroller. To reduce costs, many of these microcontrollers can only be programmed in assembly language (though in recent years many also provide C compilers). Many chips use bounding packaging (where the chip core is directly attached to the PCB and then glued with black glue; if you’ve played with LCD1602, you can see that round black disk at the back). Previously, this type of product was produced by some small chip manufacturers in Taiwan. In recent years, many chip manufacturers have emerged in mainland China, and these microcontroller industries often target specific application fields, being familiar with industry needs and directly providing solutions suitable for that industry.

People outside the industry may have never heard of the models and related information of such microcontrollers. Overall, this belongs to a relatively low-end industry, and I do not recommend people to study or enter this field. Especially now that China is undergoing industrial upgrades, outdated traditional home appliances are continuously dropping in price and failing to sell, while various high-end functional and aesthetically pleasing ‘industrial upgrade’ home appliances are generating high profits. Therefore, chips and technologies suitable for traditional outdated electronic products are not worth investing in.

· 51 Microcontroller.In fact, the 51 microcontroller is also an 8-bit microcontroller, and the reason it is singled out is that it is simply too famous. In fact, during the time when many microcontrollers were competing (around the 1980s), the 51 microcontroller was just one of many, and there were many other excellent ones, but unfortunately, they have been lost to time. The reason the 51 microcontroller is famous and still in use today is that Intel later opened the copyright of the 51 core, allowing many companies and individuals to use it without worrying about fees or copyright risks.

In reality, as of now (2018), the 51 microcontroller is already a very old solution with no technological advantages, but why is it still widely used?

The main reasons are:

First, there are a large number of existing projects and developers familiar with the 51 microcontroller. Many old engineers may only know the 51 microcontroller, and many old projects cannot be redeveloped, so they continue to use the 51 microcontroller.

Second, the 51 microcontroller is cheap enough, so many products that do not have high performance requirements simply use the 51 microcontroller.

Third, the 51 core is open, so many SoCs (such as many capacitive touch screen chips, many fingerprint recognition chips, etc.) that require an embedded microcontroller core will choose to use the 51 core because it is free and sufficient. If not this, then who else?

Many students ask me if they should still learn the 51 microcontroller?

I believe it is still worth learning. One reason is that the technical skills used in developing the 51 microcontroller will still be useful when developing other microcontrollers, making it faster to learn other microcontrollers after mastering the 51 microcontroller, so the time spent will not be wasted. Another reason is that sometimes in actual development, you may encounter situations that require the use of the 51 microcontroller, so knowing it is a skill you can showcase.

So if you want to learn microcontroller development, starting with the 51 microcontroller will definitely not be a mistake. However, remember not to get too absorbed in the 51 microcontroller; quickly learn it and then move on to learning more modern and practical microcontrollers (like STM32). Many people stop moving forward after learning the 51 microcontroller, which is akin to graduating from kindergarten and not continuing with education, which is wrong.

· STM32 Microcontroller.Finally, we come to the popular STM32, which was first released by ST in 2007 and has been around for 11 years. STM32 is a microcontroller with an ARM Cortex-M core, and in fact, many microcontrollers also use the ARM Cortex-M series cores (such as NXP’s LPC series, the former Freescale’s K60 series, Taiwan’s New Tang’s M051 series, and domestic GD32 series, etc.), with STM32 being just one of the representative works. ARM has been very strong over the years, dominating the application-level SoCs and outperforming Intel, with ARM chips dominating the mobile phone industry, while MIPS and similar architectures have been struggling to survive. In the microcontroller field, ARM’s Cortex-M series (M0, M3, M4, M7) has also been a great success, with many semiconductor manufacturers abandoning their original architectures in favor of ARM core microcontrollers.

How should I put it?

Personally, I feel that ARM core microcontrollers are very suitable for the current era, especially the STM32, which has gained market recognition in terms of hardware configuration and development tools, and its popularity is increasing. I strongly recommend that students learn STM32 when studying microcontrollers, as being proficient in STM32 is very valuable. As for domestic alternatives like GD32, I believe they will become stronger in the future, even dominating the market and pushing foreign brands out of China. The development methods for these chips are also very similar to STM32, so once you learn STM32 development, transitioning to GD32 will be easy, and you need not worry about it.

· Other Microcontrollers.I’m referring to PIC, ATmega, MSP430, STM8, etc. These are not very familiar to me, so I won’t elaborate. Overall, these microcontrollers have good cost performance and competitiveness in their respective fields, but they still do not compare to STM32 in terms of application range. Therefore, unless they are needed for company research and development, I do not recommend actively learning them.

· High-Performance, High-Price Microcontrollers.This specifically refers to microcontrollers like STM32F7, STM32H7, and NXP imxRT1052. Although these are microcontrollers, their performance is much stronger than that of general microcontrollers, with more complex peripherals, and some even require external SDRAM to provide larger memory and external SLC NAND or Spiflash for storage. From a price perspective, most of these microcontrollers cost more than 30 RMB, with some exceeding 100 RMB. These are truly the ‘fighters’ among microcontrollers, and their prices can be shocking. Personally, I am not optimistic about this type of microcontroller. The reason I wrote this long article is to explain why I am not optimistic about these high-performance microcontrollers. Interested students can continue reading the analysis below.

Technical and Market Status of Embedded Systems

The most popular areas in embedded systems currently are ARM + Linux and ARM + Android. The chips are all based on ARM, with low-end models like ARM9 and ARM11 and high-end models like Cortex-A7, Cortex-A8, Cortex-A9, Cortex-A53, Cortex-A57, etc. They range from single-core to dual-core, quad-core, and octa-core. There are many manufacturers, both domestic and imported. The coverage is broad, including consumer-grade, industrial-grade, and automotive-grade systems.

·

Embedded-level ARM chips have MMUs, allowing them to run complex operating systems well. Therefore, although the chips can run bare metal, virtually no one uses these chips for bare metal or RTOS. They will all run an operating system. In simple terms, if a product does not require a fancy and beautiful human-machine interface, Linux will be used (e.g., routers, network cameras). If a human-machine interface is needed, but the interface is simple and prioritizes functionality and stability, Linux + QT will be used (e.g., industrial HMI, electric vehicle charging piles, parking lot displays). If a product emphasizes human-machine interaction and user experience, Android will be used (e.g., smartphones, smart TVs, game consoles, etc.).

Overall, embedded systems are complex, with high development difficulty and a long learning curve. The software’s complexity increases the likelihood of bugs. Once bugs occur, finding them requires more skill and experience. Therefore, many companies face numerous problems when using embedded Linux or Android for products, partly due to the technical abilities of the developers and partly due to the company’s inability to spend time and resources to stabilize and mature the product.

The Real Difference Between Embedded Systems and Microcontrollers

As we analyze this, everyone understands the real difference between embedded systems and microcontrollers: whether there is a complex operating system like Linux or Android.

Microcontrollers either run bare metal or RTOS. Those who have experience with both RTOS and Linux know that although RTOS is also called an operating system, it is not on the same level as Linux. It is far behind, let alone Android. Any module code taken from Android is larger than a complete RTOS and more complex. Therefore, whether or not there is a complex OS like Linux/Android is indeed a significant difference in development.

For example, from the perspective of C language, my ‘Embedded Linux Core Course’ Part 4 ‘4. Deep Analysis of C Language’ is specifically designed for those with insufficient C language skills in embedded Linux development. Many students who have worked with microcontrollers for many years have expressed that they truly did not realize how deep C language can be until they worked with Linux. Structures and pointers do not showcase their charm in microcontroller programming, but they are perfectly utilized and released in the Linux kernel. Without serious study, it is difficult to experience that beauty and shock.

The Intersection of Embedded Systems and Microcontrollers

Is there an intersection between embedded systems and microcontrollers? The intersection here refers to products that can be solved by either embedded systems or microcontrollers.

In the past, there was none. Generally, microcontrollers cost a few to dozens of RMB, while embedded system SoCs plus DDR and Flash cost at least several dozens of RMB. Why would you use an embedded solution for something that can be done with a microcontroller costing a few RMB? Therefore, there was no intersection between the two before. They were not in the same range.

However, the situation has changed in the past two years. Firstly, many high-end microcontrollers’ configurations and prices have been rising. For example, the NXP imxRT1052 series microcontroller released in October 2017 is called a cross-border processor. Why is it called cross-border? What two borders does it cross?

We know that microcontrollers must provide the entire system on one chip, meaning that at least the CPU, SRAM, and Flash cannot be missing; otherwise, they cannot operate independently. Therefore, whether it is the 51 microcontroller or the STM32, they all have an internal CPU, SRAM, and Flash; this is a typical microcontroller. However, embedded system SoCs differ. For example, the S5PV210 only has a CPU and a small amount of SRAM internally; it requires external integration of DDR SDRAM and Flash (EMMC) to work properly. Thus, the embedded system cannot be on one chip; typically, a typical embedded system consists of a core board that integrates SoC, DDR SDRAM, Flash, power modules, etc.

So the so-called cross-border processor, the imxRT1052, integrates a CPU and SRAM internally but requires an external Flash chip to form a system. Hence, it is neither a typical microcontroller nor a typical embedded system, but it resembles both, which is why NXP calls it a cross-border processor. Regardless of how well it works, the name sounds cool.

By the way, why did NXP design it this way? It is mainly because microcontrollers with built-in Flash are expensive. The imxRT1052 can be cheaper than STM32 with the same performance primarily because it does not have built-in Flash. Therefore, many people say that ST is behind NXP, but in reality, it is not. It can only be said that NXP’s design is an innovation in the microcontroller field, and compared with it, STM32F7 and STM32H7 have poor cost performance. However, it must be said that the F7 and H7 of STM32 indeed have terrible cost performance; I do not understand why a microcontroller sells for over a hundred RMB. Who gives ST the courage to set such prices? Is it Liang Jingru?

Forget it; I don’t want to complain about the F7 and H7. Let’s talk about the cross-border processor imxRT1052. This device has a clock frequency of 600MHz, has consumer and industrial grades, comes with various peripherals (basically everything you can think of), and can support a maximum resolution of 1024×768 for TFT LCD (of course, it requires external SDRAM as video memory). This device is like a god among ordinary microcontrollers, and anyone familiar with microcontrollers would be shocked by these specifications. Moreover, regarding the price, the official batch price is around 30 RMB.

Think about it; it feels like an explosion in cost performance. In fact, STM32 is not that weak; although the F7 and H7 do not have a frequency as extreme as 600MHz, the overall performance of the H7 is not significantly inferior to the RT1052. Even if it does not call it ‘dad’, it cannot escape being ‘older brother’. The key reason why the F7 and H7 have not created a big wave is that their prices are frighteningly high; when most people hear that it costs over a hundred RMB, they curse and turn away, unwilling to learn about its performance. Conversely, the 30 RMB price of the imxRT1052 is indeed attractive, seeming to be a high-performance, low-price option, leading many to believe that NXP will ‘kill’ ST.

The Dilemma of Cross-Border Processors

At first glance, high-performance cross-border processors seem great, but in reality, they are not easy to succeed. The reason is that this type of high-performance microcontroller does not have an advantage compared to low-performance, high-cost-performance embedded Linux solutions.

Yes, many people think that a 600MHz microcontroller costing 30 RMB is cheap and powerful. That is because they are not familiar with embedded solutions. In fact, the imxRT1052 single chip cannot work well on its own; to achieve high performance, it needs external Flash and SDRAM. Even just 1Gbit SLC NAND and 32MB SDRAM, plus the BOM cost of RT1052, will be around 50 RMB. Moreover, although the RT1052 is claimed to have a batch price of 30 RMB, the actual small batch purchase price is around 40-50 RMB, so the market price for RT1052 core boards is between 120-150 RMB. This price is not cheap, and many embedded Linux solutions have higher cost performance than this.

For example, NXP’s imx6ul has a built-in Cortex-A7 single core, with a maximum frequency of 1.2GHz, is industrial-grade, and has all the peripherals you can think of. The market’s lowest price for a core board with 256MB SLC NAND and 256MB DDR is 119 RMB, which is even lower than that of RT1052.

In fact, there are even more cost-effective solutions, such as the NUC972 Newton board we launched, which uses the New Tang NUC972 solution, with 64MB DDR built-in and 1Gbit SLC NAND externally configured. The mainboard can be priced below 100 RMB in bulk, which is far superior to high-performance microcontrollers like the RT1052.

Many people may say that they cannot develop embedded Linux and only know how to develop microcontrollers. Therefore, the high cost-performance of Linux solutions does not concern them, while microcontroller solutions do. I want to say that this is a complete misunderstanding, a 100% misunderstanding. Why?

Microcontroller is just a three-word term; do not think that all things called microcontrollers are the same. Microcontrollers differ from one another. Do you think that a 600MHz microcontroller capable of driving a 1024×768 TFT LCD has the same development approach and difficulty as an STM32F103 costing less than 10 RMB? Software development follows hardware; what kind of performance hardware requires corresponding software development approaches and resources, and also demands that developers possess certain qualities. Therefore, do not think that all microcontrollers are friendly and easy to work with. In reality, fully utilizing the performance of high-end microcontrollers to create attractive GUIs and solving all bugs in projects is not an easy task.

Conclusion

Today’s discussion is relatively shallow, mainly addressing the origins and differences between microcontrollers and embedded systems. It has led to a comparison between high-end microcontrollers (STM32H7, imxRT1052, etc.) and high-cost-performance embedded Linux solutions. The main goal is to provide a point for reflection, guiding everyone to think about how to analyze and evaluate a chip solution, thereby better selecting suitable chip solutions for their projects.

Overall, my viewpoint is: if you can use a microcontroller costing a few to tens of RMB, then use it. If these high-cost-performance microcontrollers cannot meet the requirements and you must resort to high-performance microcontrollers costing dozens of RMB, you should indeed consider whether you should directly opt for high-cost-performance embedded Linux solutions.

Many people worry about not knowing how to develop Linux, but this should not be the way to think.

Once you truly engage in a project, you will find that using embedded Linux is not as difficult as it seems, and high-end microcontrollers combined with RTOS and a plethora of frameworks and protocol stacks are also not simple.

When problems arise, they are also hard to trace. Moreover, embedded Linux has accumulated stability over many years, and its solutions are generally quite stable. In contrast, the associated RTOS and middleware for high-end microcontrollers are often in the early stages of development and tend to have many bugs.

Therefore, I recommend that everyone invest time in learning embedded Linux software development skills.

The Love-Hate Relationship Between Embedded Systems and Microcontrollers

The Love-Hate Relationship Between Embedded Systems and Microcontrollers

Some Screenshots of Electronic Books

The Love-Hate Relationship Between Embedded Systems and Microcontrollers

[Complete Set of Hardware Learning Materials Collection]

The Love-Hate Relationship Between Embedded Systems and Microcontrollers

Leave a Comment

×