Microcontroller Types and Architectures

Microcontrollers are key components that play a central role in embedded devices. Understanding their types and characteristics is essential for efficient and reliable software development.

Although microcontrollers may seem difficult because “there are so many types,” organizing them by bit width, architecture, integrated functions, and applications makes it easier to understand the differences.

In embedded software development, “what can be done” and “what needs attention” vary depending on the microcontroller used. For high-quality product development, it is necessary to understand precautions unique to embedded software, starting with selecting the appropriate microcontroller, followed by memory management, interrupt handling, utilizing peripheral functions, setting up debugging environments, and updating firmware.

A correct understanding of microcontrollers is the first step toward creating software that operates stably.

Microcontroller Functions and Roles | Small Computers That Control Specific Devices

A microcontroller, abbreviated as “MCU” (Micro Controller Unit), is a small computer designed to control specific devices. While personal computers have the versatility to handle a wide range of applications such as document creation, video editing, and gaming, microcontrollers work as dedicated brains that reliably perform predetermined functions.

Various Functions of Microcontrollers

Compared with personal computers, microcontrollers are characterized by the extremely compact integration of various functions. Specifically, a CPU that performs calculations, a ROM that stores programs, a RAM that temporarily stores data, an I/O circuit that exchanges signals with external devices, an A/D converter (Analog-to-Digital Converter) that converts analog signals to digital, a timer for time management, and communication functions are integrated into a single chip. High integration achieves compact size, low cost, and low power consumption.

Reflexes of Embedded Devices

In addition to various functions, another essential feature of microcontrollers is “real-time control,” which immediately responds to external signals. For example, if a temperature sensor detects an abnormality, a cooling fan must be started immediately, or a safety device must be activated instantly according to the value of a vibration sensor. In this way, microcontrollers, which reliably and quickly execute predetermined functions, serve as the reflexes of embedded devices.

Microcontroller Types by Bit Width and CPU Architecture

Microcontrollers can be classified by “bit width” and “CPU architecture.” Bit width is an indicator of the amount of data a microcontroller can process at one time, and is divided into 8 bit, 16 bit, 32 bit, etc.

Differences and Applications of 8 bit, 16 bit, and 32 bit

8 bit microcontrollers feature a simple structure, low cost, and low power consumption. They are mainly used for simple control of household appliances, small-scale sensor processing, remote controls, etc. Although they are not suitable for complex processing due to limited program capacity and memory, they have a cost advantage in simple control.

16 bit microcontrollers have higher processing capability than 8 bit ones and offer an excellent balance between performance and power consumption. They are mainly used in devices that require a certain level of arithmetic capability and real-time performance, such as motor control, industrial measuring instruments, and medical equipment. They are suitable for applications where 8 bit processing cannot keep up and 32 bit is too costly.

32 bit microcontrollers are currently the mainstream. They have high arithmetic performance and can simultaneously handle everything from complex control and communication processing to graphical user interfaces. Therefore, they are used in a wide range of applications, including IoT devices, industrial equipment, automobiles, and medical equipment. In recent years, some are equipped with floating-point units (FPUs) and DSP (Digital Signal Processor) functions, enabling advanced arithmetic processing.

Item 8 bit microcontroller 16 bit microcontroller 32 bit microcontroller
Main Features Simple structure, low cost, and low power consumption Excellent balance of processing capacity, performance, and power consumption Current mainstream. High computing performance, capable of complex control and communication
Main applications Simple control of home appliances, small-scale sensor processing, remote controls Motor control, industrial measuring instruments, medical devices IoT devices, industrial equipment, automobiles, medical devices
Advantages Cost advantage in simple control Ideal for applications where 8 bit is insufficient and 32 bit is too costly Supports graphical UIs and advanced calculations (FPU/DSP)
Limitations/Weaknesses Limited program capacity and memory, not suitable for complex processing None in particular (intermediate positioning) Tends to be relatively high cost compared to 8 bit and 16 bit
Representative examples AVR Series (Arduino, etc.) RL78 Series (low power consumption design) STM32, RX, RA, and ESP32 Series, etc.

Microcontroller comparison by bit width

CPU architecture that affects microcontroller performance

The mainstream CPU architecture is the “RISC (Reduced Instruction Set Computer) type,” with the Arm Cortex-M Series being a representative example. The RISC type is characterized by simplifying instructions to achieve high-speed processing and power savings. In addition, the design is optimized for embedded applications, and development tools, documentation, and technical information are extensive.

On the other hand, there are also microcontrollers with manufacturer-proprietary CPU architectures. These have unique strengths in interrupt response speed and coordination with peripheral functions, and are highly regarded in specific applications. Among them, the ARM architecture is famous. Many companies adopt the ARM architecture and sell their own proprietary microcontrollers. In addition, recently, microcontrollers adopting RISC-V, which has an open instruction set architecture, have been attracting attention from the perspective of cost and design flexibility.

Representative Microcontroller Series and Selection Points

Widely used STM32 Series

STMicroelectronics’ STM32 Series is widely used as a general-purpose 32 bit microcontroller. It is a representative of Arm Cortex-M-based 32 bit microcontrollers, and offers a wide lineup from ultra-low power consumption models to high-performance models. The development environment and technical information are also extensive, and it is supported by many engineers.

Renesas Electronics products that are easy to use in Japan

Among Japanese manufacturers, Renesas Electronics’ RX Series and RA Series have a strong track record of adoption in Japan, and are widely used in industrial equipment, home appliances, and automotive-related fields. In particular, the extensive Japanese technical support and documentation are major advantages for developers.

Proper use according to the required application

For low power consumption and small-scale control applications, Renesas Electronics’ RL78 Series and Microchip Technology’s AVR Series are used. The RL78 is characterized by its ultra-low power consumption design, making it suitable for battery-powered products and devices that use energy harvesting. In addition, the AVR is adopted in the Arduino platform as an 8 bit microcontroller for educational purposes, making it a series that is easy for beginners to get started with.

For wireless IoT devices, Espressif’s ESP32 Series is widely used as it comes standard with Wi-Fi and Bluetooth. Nordic Semiconductor’s nRF52 Series is adopted in wearable devices, beacons, smart home devices, etc., as a product specialized in Bluetooth Low Energy (BLE).

Comprehensive Considerations Essential for Selecting a Microcontroller

When selecting a microcontroller, it is necessary to make a comprehensive assessment based not only on performance but also on factors such as power consumption, communication functions, availability, development environment, and cost. Therefore, after clarifying the specific application and required specifications, candidates are narrowed down based on necessary peripheral functions (A/D converters, timers, communication interfaces, etc.), power consumption constraints, real-time requirements, communication requirements, and budget. Furthermore, the long-term stability of product supply and the technical support system are also important selection criteria. In addition, a track record of “having used it in past development” is also one of the selection conditions. Rather than designing a new microcontroller board or setting up a new development environment, starting development in an environment that you have experience using may be faster when considering operation checks and testing.

Points to Note in Embedded Software Development

In embedded software development for microcontrollers, it is necessary to pay attention to constraints that differ from those of software for PCs. Specifically, these include “resource constraints,” “interrupt handling,” “utilization of peripheral functions,” “debugging environments,” and “firmware updates.”

Memory Requiring Meticulous Management

The most important consideration is addressing “resource constraints.” Since the memory capacity of a microcontroller is limited to about several kilobytes to several megabytes, it will quickly run out if not managed meticulously. Coding that is conscious of memory usage is required from the program design stage. In particular, management of the stack area is important, and caution is required when using recursive calls or local variables of large arrays. In addition, dynamic memory allocation and the like may cause memory fragmentation, so they should be avoided or used with caution in embedded systems.

Clarify Priorities for Interrupt Handling

The next most important consideration is the appropriate design of “interrupt handling.” Microcontrollers frequently use a mechanism called interrupts to respond immediately to external events. Since interrupt handling takes priority over other processes, performing heavy calculations or complex processing can make the operation of the entire system unstable. It is recommended to design the interrupt handler, which temporarily suspends the running program to respond to a suddenly occurring event, to be as short as possible and limited to the minimum necessary processing, and to set a flag so that time-consuming processing can be executed in the main loop. In addition, setting interrupt priorities and protecting critical sections (processing sections that require atomic operations) are also important. These designs and implementations greatly affect software quality. Since interrupts and exclusive control of resources are prone to causing bugs, testing is important along with design and implementation.

Make Effective Use of Peripheral Functions

Microcontrollers are equipped with various peripheral functions, such as timers, A/D converters, D/A converters (Digital-to-Analog Converters), DMA (Direct Memory Access), and various communication functions like UART, SPI, and I2C. If these can be utilized effectively, the CPU load can be reduced, achieving both power saving and stable operation. Especially in microcontrollers with limited processing capacity, such as 8 bit or 16 bit microcontrollers, mastering these peripheral functions affects the quality and performance of the software. For example, using DMA allows data transfer between memory and peripherals without going through the CPU. This allows the CPU to operate during that time, significantly improving processing efficiency.

Do Not Forget Debugging Environments and Firmware Updates

The preparation of a “debugging environment” is also important. Although the supported interfaces differ depending on the microcontroller, typical microcontrollers use debugging interfaces such as JTAG and SWD (Serial Wire Debug) to check program operation in real time. This allows setting breakpoints, monitoring variables, obtaining memory dumps, etc., and is indispensable for efficient debugging. In addition, it is also effective to use debugging methods such as log output using UART and status display using LEDs.

Considering the product life cycle, the mechanism for “firmware updates” is also an important point to consider. If bug fixes or function additions become necessary after shipment to the market, having a mechanism to update the firmware allows for flexible response. Implementing a bootloader, selecting communication paths (USB, wireless, SD cards, etc.), and designing a fail-safe mechanism in case of update failure should be planned from the early stages of development.

Summary

Microcontrollers are important components that play a central role in embedded devices. By classifying them from the perspectives of bit width, architecture, integrated functions, and applications, and deepening your understanding, you will be able to select the appropriate microcontroller. Furthermore, by understanding the precautions unique to embedded software, such as resource constraints, interrupt handling, utilization of peripheral functions, debugging environments, and firmware updates, you can build high-quality systems that operate stably. In this way, deeply understanding the characteristics of microcontrollers and designing software suitable for them is the foundation for excellent embedded system development.

Back to The World of Embedded Software Top