Microprocessors, Microcontrollers and their Periphery
Every new application design requires a microcontroller or microprocessor. And when making a decision between the two, there are a few factors to consider. An overview of the microprocessor and the microcontroller, and heterogeneous architectures.
When deciding between a microprocessor (MPU) and a microcontroller (MCU), the type of application is often a critical factor. The final selection, on the other hand, depends on criteria like the operating system and memory. However, sometimes a combination of the two makes sense, and this is referred to as a heterogeneous architecture.
For extensive, computer-intensive industrial and consumer applications that are based on operating systems like Linux or Android and require numerous high-speed connections or user interfaces with a broad functional scope, a microprocessor is the best choice. Because, instead of an operating system, most microcontrollers have only bare metal programming which runs programs almost without any human intervention thanks to sequential processing loops and state machines. Many high-performing microcontrollers, however, can support a real-time operating system (RTOS) such as FreeRTOS in order to respond to processes in real time in a deterministic manner for applications that require a hard real-time behavior.
As a universal operating system with a lot of free software, extensive hardware support and a growing ecosystem, Embedded Linux has enjoyed great success. A further plus point: There are no user or licensing fees due. However, an application that runs with Embedded Linux requires at least 300 to 400 DMIPS (ARM-Dhrystone MIPS) which makes a microprocessor the better choice. In this application, a microcontroller does not generate enough computing power nor is it equipped with sufficient memory. If it is a complex or a time-critical control system, then an RTOS is useful, but requires a high-performance microcontroller that offers at least 50 DMIPS.
This is much less than required for Embedded Linux; the traditional RTOS are designed to be lean so that they run on a microcontroller.
This makes sense when it concerns real-time computing hardware, such as an anti-blocking system for vehicles where too much latency in the response can have deadly consequences. Even if a larger number of functions, interrupt sources, and standard communications interfaces have to be supported, a microcontroller with RTOS is recommended.
Another main difference between microprocessors and microcontrollers consists normally in the fact that microprocessors rely on an external memory for saving and executing the program and not – as in the case of microcontrollers – on an embedded flash memory. In microprocessors, the program is normally stored on a non-volatile memory such as eMMC or Serial Flash, to name a few. During the start, it is loaded into an external DRAM and executed here. Both the DRAM as well as the non-volatile memory can have several hundred megabytes or even gigabytes. This means microprocessors are almost never limited with regard to memory capacity. One potential disadvantage is that the design of the PCB layout can be more complex due to the external memory.
Current high-performing microcontrollers, such as the STM32H7 produced by STMicroelectronis, offer maximum 2 MB program memory which can be insufficient for many applications. Because the program lies on an On-Chip memory, its advantage is that it carries out start-up and reset processes considerably faster.
Computing power is a classic selection criterion. However, the lines between microprocessors and microcontrollers have become fuzzy in this regard. This becomes obvious, for example, if you look at the ARM architecture as one of the most broadly distributed in the microcontroller and microprocessor market. ARM offers different processor architectures for various requirements:
Cortex-A offers the highest performance of all of them and is already optimized for comprehensive operating systems. They are mainly deployed in powerful devices like smart phones or in servers.
Cortex-M are smaller with a more On-Chip periphery, however, with lower energy consumption – and thereby optimized for embedded applications.
Dhrystone is used as a benchmark to compare the performance of different processors. Based on this benchmark, the difference between a typical inexpensive microcontroller with 30 DMIPS and a microcontroller with the highest currently available performance, including an embedded program flash memory, is 1027 DMIPS. In contrast, microprocessors do not start until almost 1000 DMIPS.
Microcontrollers score high when it comes to energy consumption, which is quite a bit lower than that of microprocessors. Although microprocessors have an energy-savings mode, their consumption is nevertheless considerably higher than that of a typical microcontroller. Moreover, the external memory makes it harder to switch the microprocessor to an energy-saving mode.
For ultra-low power applications in which a long battery run-time is critical and which have only a little-used or no user interface, the microcontrollers are the better choice, particularly for consumer electronics or smart meters.
The majority of the microcontrollers and microprocessors come equipped with all the conventional peripheral interfaces. However, if ultra-fast peripheral devices are required, then users will not find the relevant interfaces, such as the Gigabit Ethernet, in microcontrollers. However, they have become practically a standard feature in microprocessors. This makes complete sense because microcontrollers can barely process the data volume incurred. One key question to ask is: Are there sufficient bandwidth and channels available to handle the emerging data traffic?
If it is all about real-time performance, a microcontroller is definitely the component of choice. Thanks to its processor core, the embedded flash memory, and the software (RTOS or Bare Metal OS), the microcontroller does an outstanding job meeting its real-time tasks. Because the Cortex-A microprocessors are masters at pipelining, users can expect an increasing depth of the pipeline with higher latency times during jumps and interrupts. Hard real-time is difficult to realize due to the fact that the OS multitasks with microprocessors.
System Base ICs
A power supply is already integrated in microcontrollers, they only require one single voltage rail. Microprocessors, on the other hand, require numerous rails to supply the core and the other components. Power is supplied, for example, by special ICs, so-called system basis chips, that only have to be configured.
Nevertheless, the line between microprocessor and microcontroller is becoming visibly fuzzier. With the introduction of the STM32MP1 with one or two Cortex-A7 cores typical for a microprocessor and a Cortex-M4 core as a representative of the microcontroller class, STMicroelectronics has added to its portfolio a powerful microcontroller for performance and resource-hungry applications based on open source software.
This opens up the option of combining the advantages of both worlds. For example, an OpenST Linux can be run on microprocessor cores while the M4 core runs a FreeRTOS in order to meet the real-time and safety requirements, as needed in process monitoring. Due to this separation, all of the operating system features, such as HMI with touch control and network communication, can be used without going into the safety requirements of the entire application. Heterogeneous architectures also have an advantage when it comes to the latency time during system start or energy consumption because the more suitable processor can be used any time.
For example, with the help of its retention RAM, the M4 can wake up in milliseconds while the A7 takes up to one second in latency time to wake up. This makes it possible, for example, to keep the microprocessor in Stop mode while the microcontroller component performs an A/D conversion, which, when compared to the run-run configuration, saves about three-quarters of the energy.
Reference design for the STM32MP1
The STM32MP1 is available with the Evaluation Board (STM32MP157C-EV1) and Discovery Kit (STM32MP157C-DK2) as a reference design. Developers benefit from the support with the system design. It is based on the combination of STM32MP1 and the technologies from proven partners like Nanya. It consists of a 4-Gbit DDR3L SDRAM, a 4GB e-MMC from Kioxia (previously Toshiba) and an optimized power management IC STMPIC1 as a support chip.
It is hard to say when a microprocessor or a microcontroller is the better choice, but the rule of thumb is that you should always weigh the various pros and cons against one another. The following can be used as a rough guideline:
• Microcontrollers are ideal for more inexpensive and mobile applications in which energy consumption is a main concern, as well as for applications with real-time requirements.
• Microprocessors are perfectly suited for intense computing applications that run with an operating system and require the high-speed interfaces. Games and other graphic-intensive applications are networked using special microprocessors.
Author: Hao Wang, Product Manager Digital
Rutronik | https://www.rutronik.com