Source: Semiconductor Industry Alliance
MCU is the abbreviation for Microcontroller Unit, commonly known as a microcontroller. It reduces the frequency and specifications of the CPU appropriately and integrates memory, counters, USB, A/D converters, UART, PLC, DMA, and even LCD driver circuits onto a single chip, forming a chip-level computer for different application scenarios. MCU can be found in various applications, such as mobile phones, PC peripherals, remote controls, automotive electronics, and industrial applications like stepper motors and robotic arms.
History of Microcontroller Development
The history of microcontrollers is relatively short but has developed rapidly. Its emergence and development are generally synchronous with the emergence and development of microprocessors (CPUs). Since the first 4-bit microprocessor, the Intel 4004, was launched by Intel in the United States in 1971, its development has roughly been divided into five stages. Below is an introduction based on the development of Intel’s microcontrollers.
1971~1976
This is the initial stage of microcontroller development. In November 1971, Intel designed the first 4-bit microprocessor, the Intel 4004, with an integration of 2000 transistors per chip, equipped with RAM, ROM, and shift registers, forming the first MCS-4 microprocessor. Later, Intel introduced the 8-bit microprocessor, the Intel 8008, and other companies followed with their own 8-bit microprocessors.
1976~1980
This period represents the low-performance microcontroller stage. The MCS-48 series launched by Intel in 1976 is a representative example, which integrates an 8-bit CPU, 8-bit parallel I/O interface, 8-bit timer/counter, RAM, and ROM onto a single semiconductor chip. Although its addressing range is limited (not exceeding 4 KB), it lacks serial I/O, and the RAM and ROM capacities are small, the functionality meets the needs of general industrial control and intelligent instruments.
1980~1983
This stage marks the high-performance microcontroller phase. High-performance 8-bit microcontrollers introduced during this period generally feature serial ports, multi-level interrupt handling systems, and multiple 16-bit timers/counters. The on-chip RAM and ROM capacities increased, and the addressing range could reach 64 KB, with some chips even including A/D conversion interfaces.
1983~End of 1980s
This period is characterized by 16-bit microcontrollers. In 1983, Intel launched the high-performance 16-bit microcontroller MCS-96 series, which utilized the latest manufacturing technology, achieving a chip integration of up to 120,000 transistors per chip.
1990s
Microcontrollers have developed across multiple dimensions, including integration, functionality, speed, reliability, and application fields.
Classification and Applications of Microcontrollers
MCUs can be classified based on their memory types into two categories: without on-chip ROM and with on-chip ROM. For the chips without on-chip ROM, external EPROM is required for application (typical example: 8031); chips with on-chip ROM can be further divided into on-chip EPROM type (typical chip: 87C51), MASK on-chip ROM type (typical chip: 8051), and on-chip Flash type (typical chip: 89C51).
Based on purpose, MCUs can be classified into general-purpose and special-purpose; according to the width of the data bus and the length of data bytes that can be processed at once, they can be categorized into 8, 16, and 32-bit MCUs.
Currently, the most widely used application market for domestic MCUs is the consumer electronics sector, followed by industrial and automotive electronics markets. Consumer electronics includes home appliances, televisions, game consoles, and audio/video systems. The industrial sector encompasses smart homes, automation, medical applications, and new energy generation and distribution. The automotive sector includes automotive powertrains and safety control systems.
Basic Functions of Microcontrollers
For the vast majority of MCUs, the following functions are the most common and fundamental. The description may vary for different MCUs, but essentially they are fundamentally the same:
Timer: Although there are many types of timers, they can be categorized into two main types: one is the fixed interval timer, where the timing interval is set by the system and cannot be controlled by the user program. The system only provides a few fixed time intervals for the user program to choose from, such as 32Hz, 16Hz, 8Hz, etc. This type of timer is quite common in 4-bit MCUs and can be used for clock and timing-related functions.
The other type is the programmable timer, which, as the name suggests, allows the timing interval to be controlled by the user’s program, including options for clock source selection, prescale selection, and preset values. Some MCUs may include all three features, while others may have one or two. This type of timer is very flexible in application, and its actual usage can vary widely, with one of the most common applications being PWM output.
Since the clock source can be freely selected, this type of timer is generally combined with an event counter.
I/O Ports: Every MCU has a certain number of I/O ports. Without I/O ports, the MCU loses its communication channel with the outside world. Depending on the configurability of the I/O ports, they can be classified into the following types:
Pure input or pure output ports: This type of I/O port is determined by the MCU hardware design and can only be input or output, and cannot be set in real-time via software.
Direct read/write I/O ports: For example, the I/O ports of MCS-51 belong to this type. When the read I/O port instruction is executed, it acts as an input port; when the write I/O port instruction is executed, it automatically becomes an output port.
Programmable I/O ports: The input or output of this type of I/O port is set by the program according to actual needs, allowing for more flexible applications, such as bus-level applications like I2C bus and various LCD, LED driver control buses.
It is important to remember that for input ports, there must be a clear level signal, ensuring that they cannot be floating (this can be achieved by adding pull-up or pull-down resistors); for output ports, the output state level must consider the external connection situation, ensuring that there is no pull current or sink current in standby or static states.
External Interrupts: External interrupts are also a basic function possessed by the vast majority of MCUs, generally used for real-time triggering of signals, data sampling, and state detection. Interrupt triggering methods include rising edge, falling edge, and level triggering. External interrupts are generally implemented through input ports; if it is an I/O port, the interrupt function will only be enabled when set as input; if it is an output port, the external interrupt function will be automatically disabled (some exceptions exist in ATMEL’s ATiny series, where interrupt functionality can be triggered even when set as output).
Applications of External Interrupts: One application is detecting external triggering signals, which can be based on real-time requirements, such as controlling thyristors or detecting sporadic signals, or for power-saving needs.
Measuring signal frequencies is ideally suited for external interrupts to ensure that signals are not missed.
Data Decoding: In remote control applications, to reduce design costs, software approaches are often used to decode various encoded data, such as Manchester and PWM encoding.
Button Detection and System Wake-Up: For MCUs that enter sleep mode, external interrupts are generally required to wake them up, with the most basic form being a button press, which generates a level change.
Communication Interfaces: The communication interfaces provided by MCUs generally include SPI, UART, and I2C interfaces, described as follows:
SPI Interface: This interface is the most basic communication method provided by the vast majority of MCUs, using synchronous clock control for data transmission, with signals including: SDI (Serial Data Input), SDO (Serial Data Output), SCLK (Serial Clock), and Ready signal; in some cases, the Ready signal may be absent. This interface can operate in either Master or Slave mode, simply put, the one providing the clock signal is the Master, while the other is the Slave.
UART (Universal Asynchronous Receive Transmit): This is one of the most fundamental asynchronous transmission interfaces, with only two signal lines: Rx and Tx. The basic data format is: Start Bit + Data Bit (7-bits/8-bits) + Parity Bit (Even, Odd, or None) + Stop Bit (1~2 Bits). The time occupied by one data unit is referred to as Baud Rate.
For most MCUs, the data length, data verification method (odd parity, even parity, or no parity), stop bit length, and Baud Rate can be flexibly set through programming. This interface is most commonly used for data communication with the serial port of a PC.
I2C Interface: I2C is a data transmission protocol developed by Philips, also using two signal lines: SDAT (Serial Data Input/Output) and SCLK (Serial Clock). Its greatest advantage is that multiple devices can be connected on this bus, identified and accessed through addresses; one of the biggest benefits of the I2C bus is that it can be easily implemented in software via I/O ports, with the data transmission rate entirely controlled by SCLK, which can be fast or slow, unlike the UART interface that has strict rate requirements.
Watchdog Timer: Watchdog is also a basic configuration for most MCUs (some 4-bit MCUs may lack this feature). Most MCUs allow the program to reset the Watchdog but not to turn it off (some settings may be configured during programming, such as in Microchip’s PIC series MCUs), while some MCUs determine whether it is enabled through specific methods, such as Samsung’s KS57 series, where accessing the Watchdog register automatically enables it and cannot be turned off. Generally, the reset time for the Watchdog can be set through programming. The most basic application of the Watchdog is to provide a self-recovery capability for the MCU in case of unexpected failures leading to a crash.
Tips for Learning Microcontrollers
For any MCU, the basic principles and functions are generally similar; the differences lie only in the configuration and number of peripheral functional modules, instruction systems, etc.
Regarding the instruction system, although they may appear diverse, they are essentially just different symbols; their meanings, intended functions, and addressing methods are fundamentally similar.
To understand an MCU, the first thing to know is its ROM space, RAM space, number of I/O ports, number of timers, timing methods, provided peripheral functional modules, interrupt sources, operating voltage, and power consumption, etc.
After understanding these MCU features, the next step is to compare the functions of the selected MCU with the functional requirements of the actual project, clarifying which resources are currently needed and which are not required for the project.
For functionalities needed in the project that the selected MCU does not provide, it is necessary to thoroughly understand the relevant MCU documentation to seek indirect methods to achieve them. For example, if the project requires communication with the PC’s COM port, and the selected MCU does not provide a UART port, one might consider using an external interrupt method to achieve this.
For resources required in the project, it is crucial to carefully understand and read the Manual, while unnecessary functional modules can be ignored or skimmed through. In MCU learning, application is key and the primary goal.
Once the relevant functions of the MCU are clarified, programming can begin.
For beginners or designers using this MCU for the first time, there may be many ambiguous descriptions of the MCU’s functions. This can be addressed in two ways: one is to write special validation programs to understand the functions described in the documentation; the other is to temporarily ignore these ambiguities and write the MCU program based on current understanding, leaving room for modifications and improvements during debugging. The former method is suitable for projects with a flexible timeline and beginners, while the latter is more suitable for those with some experience in MCU development or tight project schedules.
Do not spend too much time trying to understand the instruction system. The instruction system is merely a logical description symbol; it is sufficient to refer to the relevant instructions as per your logic and the program’s logical requirements during programming. Moreover, as programming progresses, familiarity with the instruction system increases, to the point where one may even memorize it unconsciously.
Programming for Microcontrollers
Programming for MCUs differs significantly from programming for PCs. Although C-based MCU development tools are becoming increasingly popular, for efficient code and for designers who prefer assembly language, assembly remains the most concise and effective programming language.
Generally, the basic framework for MCU programming is quite consistent, typically divided into three main parts: initialization (this is the biggest difference between MCU programming and PC programming), the main program loop, and the interrupt handling program, described as follows:
Initialization: Initialization is the most fundamental and important step in the design of all MCU programs, generally including the following contents:
Mask all interrupts and initialize the stack pointer: The initialization part generally aims to avoid any interrupts occurring.
Clear the system’s RAM area and display memory: Although it may not always be completely necessary, from the perspective of reliability and consistency, especially to prevent unexpected errors, it is advisable to develop good programming habits.
Initialize I/O ports: Set the input/output modes of relevant I/O ports based on the application’s requirements. For input ports, pull-up or pull-down resistors need to be set; for output ports, the output level must be specified to prevent unnecessary errors.
Set interrupts: For all interrupt sources required by the project, they should be enabled and the triggering conditions set; unnecessary interrupts should be disabled.
Initialize other functional modules: All necessary peripheral functional modules of the MCU must be set according to the project’s application requirements, such as setting Baud Rate, data length, verification method, and Stop Bit length for UART communication, and setting clock source, prescale, and Reload Data for programmable timers.
Parameter Initialization: After completing the hardware and resource initialization of the MCU, the next step is to initialize some variables and data used in the program. This initialization part should be designed according to the specific project and overall program arrangement. For applications using EEPROM to store preset values, it is advisable to copy the relevant data to the MCU’s RAM during initialization to improve data access speed and reduce system power consumption (in principle, accessing external EEPROM increases power consumption).
Main Program Loop: Most MCUs operate continuously for long periods, so their main program body is generally designed in a loop. For applications with multiple operating modes, there may be multiple loop bodies that switch between each other through state flags. Typically, the main program body will arrange the following modules:
Computational Program: Computational programs are generally time-consuming, so they should not be placed in any interrupt, especially multiplication and division operations.
Display Transfer Program: Mainly for applications involving external LEDs and LCD drivers.
Interrupt Handling Program: Interrupt programs are primarily used to handle tasks and events that require real-time responses, such as detecting external sporadic signals, button detection and processing, timing counts, and LED display scanning.
In general, interrupt programs should be kept as concise and short as possible. For functionalities that do not require real-time processing, flags can be set in the interrupt, and the main program can execute the specific tasks—this is particularly crucial for low-power and low-speed MCUs, ensuring timely responses to all interrupts.
Different task arrangements vary by MCU: For instance, for low-speed, low-power MCUs (Fosc=32768Hz), considering that such projects are typically handheld devices using standard LCD displays, button response and display response require real-time performance, so a timer interrupt is generally used to handle button actions and data display. For high-speed MCUs, such as those with Fosc exceeding 1MHz, sufficient time is available to execute the main program loop, hence various trigger flags can be set in the corresponding interrupts, and all tasks can be executed in the main program body.
In MCU program design, it is also crucial to note: To prevent simultaneous access or modification of the same variable or data in both the interrupt and the main program body. An effective preventive method is to arrange the processing of such data within a single module, determining whether to execute the relevant operations based on the trigger flag; in other program bodies (mainly interrupts), only the trigger flags should be set for data processing. — This ensures that data execution is predictable and unique.
Global Leading Microcontroller Manufacturers
North America and Europe
1. Freescale+NXP: Netherlands, primarily provides 16-bit and 32-bit MCUs. Applications include automotive electronics, LED and general lighting, healthcare, multimedia fusion, home appliances, power tools, building automation, motor control, power supplies and converters, energy and smart grids, automation, and computer and communication infrastructure.
2. Microchip+Atmel: USA, primarily provides 16-bit and 32-bit MCUs. Applications include automotive electronics, industrial, motor control, automotive, building automation, home appliances, home entertainment, industrial automation, lighting, IoT, smart energy, mobile devices, and computer peripherals.
3. Cypress+Spansion: USA, primarily provides 8-bit, 16-bit, and 32-bit MCUs. Applications include automotive electronics, home appliances, medical, consumer electronics, communications and telecommunications, industrial, and wireless.
4. ADI: USA, primarily provides 8-bit, 16-bit, and 32-bit MCUs. Applications include aerospace and defense, automotive applications, building technology, communications, consumer electronics, energy, healthcare, instrumentation and measurement, motors, industrial automation, and security.
5. Infineon: Germany, primarily provides 16-bit and 32-bit MCUs. Applications include automotive electronics, consumer electronics, engineering, commercial and agricultural vehicles, data processing, electric transportation, industrial applications, medical devices, mobile devices, motor control and drive, power supplies, solutions for electric bicycles and small electric vehicles, smart grids, lighting, and solar system solutions.
6. ST Microelectronics: Italy/France, primarily provides 32-bit MCUs. Applications include LED and general lighting, transportation, healthcare, multimedia fusion, home appliances, power tools, building automation, motor control, power supplies and converters, energy and smart grids, automation, and computer and communication infrastructure.
7. Qualcomm: USA, primarily provides 16-bit and 32-bit MCUs. Applications include smartphones, tablets, and wireless modems.
8. Texas Instruments: USA, primarily provides 16-bit and 32-bit MCUs. Applications include automotive electronics, consumer electronics, medical devices, mobile devices, and communications.
9. Maxim: USA, primarily provides 32-bit MCUs. Applications include automotive electronics, consumer electronics, industrial applications, and security.
East Asia
1. Renesas: Japan, primarily provides 16-bit and 32-bit MCUs. Applications include computers and peripherals, consumer electronics, health and medical electronics, automotive electronics, industrial, and communications.
2. Toshiba: Japan, primarily provides 16-bit and 32-bit MCUs. Applications include automotive electronics, industrial, motor control, wireless communication, mobile phones, computers and peripherals, imaging and audio/video, consumer electronics (home appliances), LED lighting, security, power management, and entertainment devices.
3. Fujitsu: Japan, primarily provides 32-bit MCUs. Applications include automotive, medical, machinery, and home appliances.
4. Samsung Electronics: South Korea, primarily provides 16-bit and 32-bit MCUs. Applications include automotive electronics, industrial, motor control, automotive, building automation, home appliances, home entertainment, industrial automation, lighting, IoT, smart energy, mobile devices, and computer peripherals.
Taiwan Region
1. Holtek: Taiwan, primarily provides 32-bit MCUs. Applications include communications, industrial control, information home appliances, and voice.
2. Nuvoton: Taiwan, primarily provides 8-bit and 32-bit MCUs. Applications include consumer electronics, LED lighting, etc.
3. Sunplus: Taiwan, primarily provides 8-bit and 16-bit MCUs. Applications include home audio and video.
4. Nuvoton Technology: Taiwan, primarily provides 4-bit and 8-bit MCUs. Applications include chargers, power banks, home appliances, and industrial control.
5. Sunplus Technology: Taiwan, primarily provides 8-bit and 32-bit MCUs. Applications include remote controls, smart chargers, various systems, electronic scales, ear thermometers, blood pressure monitors, tire pressure monitors, and various measurement and health equipment.
6. Winbond: Taiwan, primarily provides 8-bit and 16-bit MCUs. Applications include automotive electronics, industrial electronics, networking, computing, consumer electronics, and IoT.
7. Tenxun Technology: Taiwan, primarily provides 4-bit, 8-bit, and 51-bit MCUs. Applications include remote controls and small appliances.
8. Youhua Microelectronics: Taiwan, primarily provides 4-bit and 8-bit MCUs. Applications include recording integrated circuit products, consumer electronics, and household products.
9. YG Technology: Taiwan, primarily provides 4-bit and 8-bit MCUs. Applications include machinery, automation, home appliances, and robotics.
10. Yilong Electronics: Taiwan, primarily provides 8-bit and 16-bit MCUs. Applications include consumer electronics, computers, and smartphones.
Mainland China Region
1. Sigma Microelectronics: Primarily provides 32-bit MCUs, applications include telecommunications, manufacturing, energy, transportation, and electricity.
2. Zhuhai Obit: Primarily provides 32-bit MCUs, applications include aerospace: star-arrow station ships, aircraft; high-end industrial control: embedded computers; ship control, industrial control, power equipment, environmental monitoring.
3. GigaDevice: Primarily provides 32-bit MCUs, applications include industrial automation, human-machine interfaces, motor control, security monitoring, smart homes, and IoT.
4. Shengxi Microelectronics: Primarily provides 8-bit and 32-bit MCUs, applications include small appliances, consumer electronics, remote controls, mice, lithium batteries, digital products, automotive electronics, medical instruments, and measurement, toys, industrial control, smart homes, and security.
5. Chipsea Technologies: Primarily provides 16-bit and 32-bit MCUs, applications include instrumentation, IoT, consumer electronics, home appliances, and automotive electronics.
6. United Microelectronics: Primarily provides 8-bit and 16-bit MCUs, applications include consumer electronics, white goods, industrial control, communication equipment, automotive electronics, and computing.
7. Zhuhai Jianrong: Primarily provides 8-bit MCUs, applications include home appliances and power banks.
8. Juchip Technology: Primarily provides 8-bit to 32-bit MCUs, applications include tablets, smart homes, multimedia, Bluetooth, and Wi-Fi audio.
9. Aisico Microelectronics: Primarily provides 8-bit and 16-bit MCUs, applications include consumer chips, communication chips, information chips, and home appliances.
10. Huaxin Microelectronics: Primarily provides 8-bit and 4-bit MCUs, applications include satellite receivers, mobile phone chargers, perpetual calendars, and multi-functional remote controls.
11. Shanghai Beiling (Hua Da Semiconductor Holdings): Primarily provides 8-bit, 16-bit, and 32-bit MCUs, applications include computer peripherals, HDTV, power management, small appliances, and digital appliances.
12. Haier Integrated Circuits: Primarily provides 14-bit, 15-bit, and 16-bit MCUs, applications include consumer electronics, automotive electronics, industrial, and smart instruments.
13. Beijing Junzheng: Primarily provides 32-bit MCUs, applications include wearable devices, IoT, smart home appliances, automotive, consumer electronics, and tablets.
14. Zhongwei Semiconductor: Primarily provides 8-bit MCUs, applications include smart home appliances, automotive electronics, security monitoring, LED lighting and landscape, smart toys, smart homes, and consumer electronics.
15. Shenzhou Longxin Integrated Circuit: Primarily provides 32-bit MCUs, applications include power monitoring, smart grids, industrial digital control, IoT, smart homes, and data monitoring.
16. Unisoc Microelectronics: Primarily provides 8-bit and 16-bit MCUs, applications include smart home appliances.
17. Times Minxin: Primarily provides 32-bit MCUs, applications include automotive navigation, traffic monitoring, fishing boat supervision, and power telecommunications networks.
18. China Resources Silicon Microelectronics (subsidiary of China Resources Microelectronics): Primarily provides 8-bit and 16-bit MCUs, applications include consumer electronics, industrial control, and home appliances.
19. Guoxin Technology: Primarily provides 32-bit MCUs, applications include information security, office automation, communication networks, and information security.
20. Zhongtian Micro: Primarily provides 32-bit MCUs, applications include smartphones, digital TVs, set-top boxes, automotive electronics, GPS, e-readers, and printers.
21. China Resources Microelectronics: Primarily provides 8-bit and 16-bit MCUs, applications include home appliances, consumer electronics, and general control circuits for industrial automation.
22. Zhongying Electronics: Primarily provides 4-bit, 8-bit, 16-bit, and 32-bit MCUs, applications include home appliances and motors.
23. Lingdong Microelectronics: Primarily provides 32-bit MCUs, applications include motor control, Bluetooth control, high-definition display, wireless charging, drones, micro printers, smart labels, e-cigarettes, LED dot matrix screens, etc.
24. New Tang Technology: Primarily provides 8-bit MCUs, applications include lighting, IoT, etc.
25. Neusoft Zhaibo: Primarily provides 8-bit and 32-bit MCUs, applications include home appliances, smart homes, instrumentation, LCD panel controllers, and industrial control.
26. Betley: Primarily provides 32-bit MCUs, applications include smart homes, industrial control, and consumer product fields.
27. Shengquan Technology: Primarily provides 8-bit MCUs, applications include automotive, education, industrial control, and medical small and medium-sized display panels.
28. Hangsung Chip: Primarily provides 8-bit and 32-bit MCUs, applications include automotive and IoT.
29. Fudan Microelectronics: Primarily provides 16-bit and 32-bit MCUs, applications include smart meters and smart locks.
30. Huada Semiconductor: Primarily provides 8-bit, 16-bit, and 32-bit MCUs, applications include industrial control, smart manufacturing, smart living, and IoT.

Public Account ID: imecas_wx

