Microcontroller vs Microprocessor, what to choose?

30/04/2021, hardwarebee

Microcontroller vs microprocessor selection can be a tricky process during a digital design, and engineers still struggle to find the right compromise between power consumption, computational capabilities, embedded features and price. The first big decision a designer should make during the project is to whether implement a microcontroller vs microprocessor as the main logical unit. To help you in this task, here we present and compare the main differences between microcontrollers and microprocessors and will help you choose whether to use Microcontroller or microprocessor. Let’s start.


What is a Microprocessor


Microprocessors are the core of any modern computer: they are single chip processing units responsible for computing each operation stored in the program. The microprocessor reads the algorithm from an external memory, and executes the commands using a specific language. This language defines the type of microprocessor, which can be RISC (Reduced Instruction Set Computer) or CISC (Complex Instruction Set Computer).


The entire design chain of a microprocessor is focused on improving its computational power and efficiency, with little to no care for internal peripherals. This allows the creation of extremely fast, precise, and efficient computation units. However, because the entire manufacturing process is dedicated for processing only, a microprocessor requires the use of external peripherals, such as memory, I/O pins, serial communication, power control. Figure 1 shows the functional diagram of a digital board applying a microprocessor, and how it interacts with the external peripherals. Because it does not have internal memories, the microprocessor cannot be programmed directly, and it can only run instructions provided by the ROM memory.



Figure 1: Typical microprocessor application diagram


What is a Microcontroller


Microcontrollers are more complete logical units: they incorporate, in a single chip, the microprocessor and all required peripherals: memories, I/O pins, timers, serial interface, analog-to-digital converters, power management, etc. This allows for easier application in single tasks: the designer only need to choose the microcontroller instead of selecting all the peripherals and design the interface between them. Different from a microprocessor, a microcontroller is programmable, that is, it can receive and store code via serial or parallel communication.


Microcontrollers are embedded devices, typically being optimized for the specific tasks they are designed for. They are embedded inside cars, smartphones, alarms, and refrigerators. However, general purpose microcontrollers are also largely available in the market. These microcontrollers are designed for prototyping, and are often sold embedded in development boards, for prototyping. A popular example of development boards is the Arduino Uno, which uses an 8-bit ATMega microcontroller as its core.





Figure 2: Basic microcontroller with internal peripherals


Architecture Comparison


The fundamental differences between microprocessors and microcontrollers resides on the architecture. The main blocks that compose a typical microprocessor are Figure 3. The Arithmetic Logic Unit (ALU) is a combinational digital circuit responsible for executing simple operations between integers (addition, subtraction, combinatory logic), being the fundamental block of the microprocessor. Besides the ALU, the basic microprocessor architecture requires registers. Registers are digital circuits able to store values inside the CPU, and they are necessary to accumulate the output values and the status of the ALU, which may serve as inputs to the next operation. Finally, the control unity is responsible for synchronization, communication and data transfer between the microprocessor and the outside peripherals. The reader should keep in mind that the diagram presented in Figure 3 describes the fundamental block of an microprocessor, which can be used to create more complex logical blocks, such as the Floating-Point Units (FPU).



Figure 3: General diagram of a microprocessor


In terms of memory access, microprocessors are usually based on the von Neumann architecture, storing both program and data in the same memory. In contrast, microcontrollers possess internal memory modules, which facilitates the implementation of the Harvard architecture, which separates the program memory from the data memory. This allows for faster and more organized memory allocations, reducing the complexity of the program.


Application Comparison

Microcontrollers are more suitable for applications that require optimized cost and reduced number of components. Due to the smaller number of external components required, they can be easily implemented in portable devices. For instance, microcontrollers are largely used on smart watches, mobile phones, cameras, and automobiles. Microcontrollers are also the best choice in applications that require a high level of determinism and reliability, as the whole digital system is designed to work properly from the factory, whereas microprocessor applications require the whole digital system to be developed by the designer, which may introduce functional errors. As the name suggests, microcontrollers are more suitable on controlling processes, receiving sensor data, processing it, and providing controlling signals to external actuators.




Due to the need of external components, microprocessor applications have usually higher cost and higher power consumption. Therefore, microprocessors are applied in situations where computational performance is critical, such as personal computers, high quality video processing and advanced data processing. Also, microprocessors are a good choice in applications that require peripherals with more capabilities than a microcontroller can offer, such as large memories and fast communication speed. Basically, microprocessors are required in applications where large amounts of data should be processed in a short period of time, such as high-speed communication systems, personal and multipurpose computers, video processing and computer vision. This type of application also often requires more than one microprocessor, which makes the use of microcontrollers very limited.


Memory Comparison


As discussed previously, microprocessors can not operate without external memory blocks. This includes the ROM memory to store the programmed algorithm and the RAM memory to manipulate data. Although this increases the final price and power consumption of the system, the use of external memories provides flexibility to use larger code size and process larger amounts of data.


On the other hand, microcontrollers possess internal memories, that provide the necessary storage capability for simple tasks. This provides optimized power consumption, as well as less cost and engineering time. However, the designer is limited to the capabilities provided by the microcontroller: for instance, the program memory of a microcontrollers is usually limited to 2 Mbytes of space. Because microcontrollers are more focused on single tasks, the memory size cannot be enough for some cases. Applications that require large sets of data to be stored may not be compatible with available microcontrollers in the market.


Power Consumption Comparison


Considering the chip itself only, microcontrollers are typically more suitable for low-power applications. Firstly, modern microcontrollers provide more low-power modes (IDLE, sleep, standby) than typical microprocessors. Secondly, microprocessors require external hardware, which may not be optimized for low power operations. In contrast, the internal peripherals of a microcontroller are designed to work harmoniously using the optimal amount of power for a certain operation mode. Therefore, for power sensitive applications and battery powered devices, microcontrollers are typically the best option.

Another fundamental difference is the design of the power supply. Microcontrollers require only one power supply for the whole system, as the voltage adjustments, if needed, are performed internally by the integrated circuit itself. Microprocessors, on the other hand, may require several voltage rails for different digital blocks, which may increase cost and complexity.

Size Comparison


Microprocessor-based systems are larger than equivalent microcontroller-based systems. The use of external hardware requires a printed circuit board containing all peripheral components, intercommunication buses and power converters necessary to perform the desired task. In contrast, microcontrollers are single chip devices, which can be easily embedded within a larger circuit without occupying significant space.


Price Comparison


Microcontrollers are typically cheaper than microprocessors. This is because the designer acquires the complete system, without needing to buy each peripheral separately and designing the interconnection circuit. Also, microprocessors operate at much larger frequencies than microcontrollers, which makes the overall circuit more expensive. However, microprocessors should only be implemented in applications that requires faster processing and powerful peripherals, justifying the increase in cost.


Conclusion Microcontroller vs Microprocessor


Microprocessors and microcontrollers are devices designated to similar niches, and its application range may overlap in some cases. However, they are designed for different things: microcontrollers are intended to control a system, receiving information from external sensors and making a decision to perform a single task, whereas microprocessors are designed to process large amounts of data very fast, and operate in a more general fashion. Before selecting between both, the engineer should consider the type of application intended, the amount of processing power needed, and design constraints, such as memory, power consumption, cost, and size.


Microcontroller vs Microprocessor

Recent Stories