Article Technical Rating: 7 out of 10
Just about any new electronic product requires some sort of “brains”. The question though is what type of brains does your product really need? There are two choices: a microcontroller unit (MCU) or a microprocessor unit (MPU).
As the name implies a microcontroller excels at “controlling” other hardware components (sensors, switches, motors, etc.), whereas a microprocessor excels at “processing” large amounts of data very quickly.
That being said, microcontrollers are able to also process data, and microprocessors are able to control other devices. But each excels in one area.
Selecting the correct option is one of the most important first steps to developing your new electronic product.
A microcontroller contains a central processing unit (CPU), memory, and peripherals all embedded in a single chip. A MCU is a highly integrated computer chip designed to mostly stand on its own without the need for external support chips.
The central processing unit inside of a microcontroller is essentially the same as a microprocessor. So fundamentally a microprocessor is just a CPU. On the other hand, a MCU includes a CPU plus memory and peripherals so:
Microprocessor (MPU) = CPU
Microcontroller (MCU) = CPU + Memory + Peripherals
The first rule to remember is that whenever it is possible, use a microcontroller! Only consider a microprocessor if it is absolutely required. I estimate that probably 90% of the product ideas that are presented to me can be best served with a microcontroller.
Only about 10% of products are really complex enough to warrant a faster microprocessor.
I recommend approaching this decision by assuming your product can use a microcontroller, until you can prove otherwise.
Although, there will be some applications that are best served with both a microcontroller and a microprocessor. For instance, an advanced robot with artificial intelligence, facial recognition, speech processing, and a complex graphical user interface will require a fast microprocessor.
On the other hand, the robot also needs to incorporate sensors and motors. Those functions are best controlled by a microcontroller separate from the core microprocessor. The microcontroller will act as a subsystem that interfaces with the microprocessor.
Arduino / Raspberry Pi
If you already have a Proof-of-Concept (POC) prototype based on an Arduino, then your choice is much easier.
An Arduino is based on a microcontroller, and a rather simple one at that. If you’ve been able to create a Proof-of-Concept prototype for your product using an Arduino then a microcontroller is likely the right choice for production.
If, on the other hand, you built your POC prototype using a microprocessor development kit such as a Raspberry Pi, then your choice isn’t quite so clear. I’ve seen a good number of projects built on a Raspberry Pi, that could in fact have been more easily created using an Arduino.
So, just because you have been using a Raspberry Pi doesn’t necessarily mean your production product requires such a high-speed processor.
|WiFi||MCU / MPU|
|HD 720p camera||MCU / MPU|
|HD 1080 camera||Microprocessor|
|AMOLED display||MPU or STM32F69 MCU|
|Long battery life||Microcontroller|
|Advanced data processing||Microprocessor|
|Graphical User Interfaces||MCU or MPU|
|3rd-party network connectivity||Microprocessor|
Table 1 – Preferred solution for various functions/features
For standard definition video a microcontroller is usually up to the task. In fact, a fast microcontroller can even handle 720p high-definition video just fine. However, once you exceed 720p and move to 1080 then it becomes necessary to use a more advanced microprocessor.
When it comes to video the decision whether to use a microcontroller or microprocessor many times comes down to the communication interfaces available and not necessarily the processing speed.
There are many protocols used to interface cameras and displays to your product’s brains. Many, but not all, of these are supported by microcontrollers.
For lower resolutions cameras a relatively simple serial protocol such as SPI is a reasonable option. However, for higher resolution cameras it becomes necessary to use a parallel interface to meet the necessary data throughput speeds.
A parallel camera interface can be used just fine with most microcontrollers, up to a resolution of 720p. Once you exceed the resolution of a 720p camera the data speeds need to be much higher.
Most cameras with resolutions higher than 720p use a very high speed serial video interface known as MIPI (actually that is the name of the organization that oversees this standard).
Specifically, cameras use an interface known as MIPI-CSI and displays use an interface protocol known at MIPI-DSI. These two protocols are used in almost all modern smart phones to communicate between the display and cameras.
Because of this fact there are numerous displays and cameras available only with a MIPI interface.
Up until a couple years ago MIPI interfaces were only found in the realm of high-speed microprocessors (sometimes also called application processors). If you were developing a product that uses an advanced, high-resolution, AMOLED display, then you had to use a microprocessor.
Fortunately, ST Microelectronics changed all of that with their STM32F469 microcontroller (the STM32 series is overall my favorite line of microcontrollers). The STM32F469 is based on a blazingly fast ARM Cortex-M4 32-bit processor core. The STM32F469 is the world’s first microcontroller to incorporate a MIPI-DSI interface.
So if your product requires an advanced display with a MIPI-DSI interface you can now use a microcontroller. Unfortunately, the STM32F469 doesn’t include the MIPI-CSI interface so you’re still limited in your selection of HD cameras.
If you require a 1080 camera, for example, you will still need to use a microprocessor, not a microcontroller.
Want to incorporate the new, insanely fast USB 3.0 standard in your product? If so, you’re going to need to match it with a really fast microprocessor. USB 2.0 has a maximum theoretical speed of 480 Mbits/sec (60 MB/s).
Most slower microcontrollers only incorporate USB 2.0 Full-Speed mode which is rated at only 12 Mbits/sec. There are plenty of higher-end microcontrollers that can support USB 2.0 High-Speed mode at up to 480 Mbits/sec.
The new USB 3.0 standard blows these specs out of the water with a maximum throughput speed about 10 times faster than USB 2.0 at 5 Gbits/sec (640 MB/s).
There are no microcontrollers available that can handle such an incredibly high data transfer speed. If you want to incorporate USB 3.0 you have to use a much faster microprocessor.
If your product requires complex data to be quickly processed then a microprocessor is most likely going to be required. One way around this requirement is to offload your processing requirements to a smart phone.
For example, you could potentially use a microcontroller in your device to collect the necessary data. Then transfer that data over to a mobile app for any advanced processing requirements.
|MCU/MPU||Max. clock speed (MHz)||Benchmark (DMIPS)|
|STM32F0 (Cortex M0)||48||38|
|STM32F4 (Cortex M4)||180||225|
|STM32F7 (Cortex M7)||216||462|
|STM32H7 (Cortex M7)||400||856|
|Raspberry Pi 3||1,200||2,760|
Table 2 – Speed comparison for various microcontrollers
The processor in your smart phone is obviously extremely fast. This can be a simple trick for some applications that will allow you to get by with a simpler, lower cost microcontroller that won’t drain your battery so quickly.
Graphical User Interfaces (GUI)
For a simple GUI interface it’s completely possible to use a microcontroller. However, as the complexity and resolution of this graphical interface increases so do the needs for processing speed.
Using a higher-end microcontroller allows you to develop some pretty sophisticated user interfaces. For example, the STM32F469 microcontroller includes a hardware graphics accelerator allowing it to be used to create very complex, graphical user interfaces.
There may become a point however where it becomes necessary to use an even faster microprocessor for truly advanced, very high-resolution user interfaces.
When it comes to conserving battery life, a microcontroller is the clear winner. The slower speeds of a microcontroller translate to less current consumption.
For example, an Arduino Uno consumes a maximum current of around 45mA, whereas a Raspberry Pi 3 consumes about 580mA.
However, most microcontrollers also implement various low-power modes that allow it to enter standby or sleep states. The current consumption may drop from tens or hundreds of milliamps when running to only a few microamps when in standby mode. An external interrupt can be used to wake up the microcontroller.
If battery life, or ultra-small size, is critical for your product then you will most likely want to use a microcontroller. This is why many smart watches use microcontrollers.
If you need access to large amounts of really fast memory then a microprocessor is likely your best option. A microcontroller is already embedded with memory so the memory choices are fewer than with a microprocessor.
The maximum amount of FLASH memory available with most microcontrollers is usually around 2MB. However, it is possible to incorporate additional external FLASH memory into a microcontroller system.
This memory typically interfaces with the microcontroller via a fairly fast SPI serial interface (faster microcontrollers even support quad-SPI).
Need lots of high-speed RAM memory? Then you likely need a microprocessor. Adding high-speed DDR RAM memory to a microcontroller system is not practical and that is the domain of a microprocessor.
One major difference between a MCU and MPU is that a microprocessor requires an operating system such as Windows, Android, or Linux. On the other hand, a microcontroller can run straight firmware without the requirement of an operating system.
This doesn’t mean a MCU can’t run an operating system but the choices are more limited, usually to some sort of real-time operating system (RTOS). For starters, an operating system requires quite a bit of processor overhead and memory.
For example, running a full operating system such as Windows, Android, or Linux will require 300+ DMIPS of processor speed overhead.
Whereas, a RTOS may only require around 50 DMIPS of processing speed, and a few kB of memory for the OS kernel.
If your product needs to incorporate HD video with a resolution greater than 720p then you definitely need a microprocessor.
The same is true if you want to be able to use the maximum transmission speeds possible with the new USB 3.0 standard.
Finally, if you need to process lots of data, or complex data, then you need a MPU.
For just about every other type of product and function, a microcontroller is the right answer. The performance range available with microcontrollers is quite large and you have a huge selection at your fingertips.
You may also be interested in these other articles:
If you need engineering technical support, coaching, training, connections, referrals, and resources to help bring your new electronic hardware product to market then be sure to check out the Hardware Academy.
The key to success is knowledge of the obstacles that lie in your path and a realistic plan on how to overcome those obstacles. Helping you accomplish this is the goal of the Predictable Hardware Report.