First, “embedded” is a concept with no precise definition; different books provide their own definitions. However, the main idea is the same: compared to general systems like PCs, embedded systems are specialized systems, streamlined in structure, retaining only the necessary parts in hardware and software while eliminating the unnecessary ones. Therefore, embedded systems generally have characteristics such as portability, low power consumption, and single-purpose performance.
Then, MCU, DSP, and FPGA all belong to the category of embedded systems and are tools used to achieve specific purposes.
MCU, commonly known as “microcontroller,” has developed significantly over the years and is no longer just the Princeton structure 51; its performance has greatly improved. Since MCUs must execute programs sequentially, they are suitable for control tasks and are widely used in industry. ARM is originally a company specialized in designing MCUs; due to its advanced technology and appropriate strategies, its market share in the microcontroller market has been enormous in recent years. ARM microcontrollers come in many varieties, from low-end M0 (small appliances) to high-end A8 and A9 (smartphones, tablets), making them highly sought after. Thus, ARM microcontrollers do not necessarily need to run an operating system; it depends on the application scenario.
DSP, or Digital Signal Processor, has a different structure from MCUs, increasing computation speed and emphasizing computational capability. It can be viewed as a super-fast MCU. Low-end DSPs, such as the C2000 series, are mainly used in motor control, although TI seems to refer to it as DSC (Digital Signal Controller), which is something between an MCU and a DSP. High-end DSPs, like the C5000/C6000 series, are generally used in video image processing and communication devices that require extensive computations.
FPGA, or Field Programmable Gate Array, has no inherent functionality; it is like a blank slate, and its capabilities rely entirely on the design by programmers (all processes are hardware, including VHDL and Verilog HDL programming, which are also considered hardware, generally referred to as writing “logic”). If you are skilled enough, you can turn it into an MCU or a DSP. Since the internal structures of MCUs and DSPs are predefined, they can only perform sequential processing through software programming, whereas FPGAs can handle both parallel and sequential processing, making them comparatively faster.
So why do MCUs, DSPs, and FPGAs coexist? That is because the internal structures of MCUs and DSPs are carefully designed by IC designers, and they consume less power and cost much less than FPGAs when achieving the same functionality. Moreover, FPGA development itself is quite complex, requiring significantly more manpower and resources to achieve the same functionality. Thus, all three have their strengths and areas of application. However, there is a trend of integration among the three; for example, ARM’s M4 series has added a streamlined DSP core, TI’s DaVinci series is essentially an ARM + DSP structure, and the new FPGAs from ALTERA and XILINX include ARM cores. Therefore, the relationship among the three is increasingly like three overlapping circles of primary colors.
In summary, “you exist within me, and I exist within you.”
Where to Start Learning for Hardware Engineers?
Microcontroller: Typically operates without an operating system and is used for simple controls, such as elevators and air conditioners.
DSP: Used for complex calculations, such as Discrete Cosine Transform and Fast Fourier Transform, commonly used in image processing and devices like digital cameras.
ARM: A British chip design company that does not produce chips but sells intellectual property.
FPGA: Field Programmable Gate Array, circuit design completed using hardware description languages (Verilog or VHDL) that can be quickly programmed onto an FPGA for testing, is the mainstream technology for modern IC design verification.
Embedded systems are specialized systems compared to desktop computers, customizable in various forms, often limited in size, power consumption, and cost, with high real-time requirements, such as oscilloscopes, smartphones, tablets, fully automatic washing machines, routers, and digital cameras. Although the presence of desktop computers is not visible in these devices, one or more embedded systems are at work.
Different choices are provided based on the complexity of the functional system and the complexity of computational processing. For simple household control embedded systems, a simple 8-bit microcontroller is sufficient, being cost-effective, while for smartphones and game consoles, 32-bit ARM and DSP chips must be used. FPGA is a more hardware-oriented implementation method.
Thus, to become a hardware engineer through learning, one should start with microcontrollers and then learn about ARM and DSP.
Detailed Introduction to the Seven Mainstream Microcontrollers on the Market
Microcontrollers are now ubiquitous and come in various types, overwhelming developers, and their development has been rapid, evolving from 4-bit and 8-bit in the 1980s to various high-speed microcontrollers today.
Various manufacturers are competing in speed, memory, and functionality, resulting in a wide range of products. A large number of representative microcontroller manufacturers have emerged: Atmel, TI, ST, MicroChip, ARM… domestically, the Hongjing STC microcontroller is also commendable.
Below is a comparison of the advantages and disadvantages of 51, MSP430, TMS, STM32, PIC, AVR, and STC microcontrollers and their functionalities…
51 Microcontroller
The most widely used 8-bit microcontroller, and also the easiest for beginners to learn, was first introduced by Intel. Due to its typical structure and centralized management of dedicated registers, numerous logical bit operations, and a rich instruction set aimed at control, it is regarded as a “classic” that laid the foundation for the development of other microcontrollers.
The 51 microcontroller has become a classic and an easy-to-learn microcontroller mainly due to the following characteristics:
Characteristics:
1. There is a complete bit operation system from hardware to software, called a bit processor, which processes bits rather than words or bytes. It can handle specific bits of certain special function registers within the chip, such as transferring, setting, clearing, testing, etc., and can also perform logical operations on bits, making it very comprehensive and user-friendly.
2. A dual-function address area is specially opened in the internal RAM, allowing for great flexibility, which undoubtedly provides great convenience for users.
3. Multiplication and division instructions make programming easier. Many 8-bit microcontrollers do not have multiplication functionality and require additional subroutine calls for multiplication, which is very inconvenient.
Disadvantages: (Although it is classic, its shortcomings are still evident)
1. Functions like AD and EEPROM require expansion, increasing the hardware and software burden.
2. Although the I/O pins are simple to use, they have no output capability at high levels, which is the biggest weakness of the 51 series microcontrollers.
3. The operating speed is too slow, especially with dual data pointers; improving this would greatly ease programming.
4. The 51 has poor protection capabilities and is easily damaged.
Application Range:
Currently widely used in educational settings and scenarios where performance requirements are not high.
Most used devices: 8051, 80C51
MSP430 Microcontroller
The MSP430 series microcontroller is a 16-bit ultra-low-power mixed-signal processor that Texas Instruments launched in 1996, known for its low power consumption and fast speed. Its assembly language is flexible, with many addressing modes, few instructions, and easy to learn. This is mainly due to its integration of many analog circuits, digital circuits, and microprocessors on a single chip to provide a “single-chip” solution. Its rapid development and expanding application scope mainly depend on the following features…
Characteristics:
1. Strong processing capability, using a Reduced Instruction Set Computing (RISC) architecture, with rich addressing modes (7 source operand addressing, 4 destination operand addressing), a concise set of 27 core instructions, and numerous analog instructions; a large number of registers and on-chip data memory can participate in various calculations; it also has efficient table processing instructions; with a high processing speed, under 8MHz crystal drive, the instruction cycle is 125 ns. These features ensure high-efficiency source programs can be compiled.
2. In terms of processing speed, it can achieve a 125ns instruction cycle under an 8MHz crystal drive. The 16-bit data width, 125ns instruction cycle, and multifunctional hardware multiplier (which can achieve multiplication and addition) work together to implement certain algorithms in digital signal processing (such as FFT).
3. The ultra-low power consumption of the MSP430 microcontroller is attributed to its unique approach to reducing the chip’s power supply voltage and flexible controllable operating clock. The power supply voltage is 1.8~3.6V. Thus, under 1MHz clock conditions, the chip’s current is around 200~400uA, and the minimum power consumption in clock shutdown mode is only 0.1uA.
Disadvantages:
1. Personally, I feel it is not easy to learn and is not suitable for beginners; the documentation is also relatively scarce, often requiring users to search the official website.
2. It occupies a large instruction space since it is a 16-bit microcontroller, with some instructions occupying up to 6 bytes. Although the program appears concise, it occupies much more space compared to PIC microcontrollers.
Application Range:
More commonly used in low-power and ultra-low-power industrial applications.
Most used devices: MSP430F series, MSP430G2 series, MSP430L09 series
TMS Microcontroller
Here, we also mention the TMS series microcontrollers, although they are not mainstream. Introduced by TI, the 8-bit CMOS microcontroller has various storage modes and peripheral interface modes, suitable for complex real-time control scenarios. Although it is not as excellent as STM32, nor as flamboyant as MSP430, the TMS370C series microcontroller offers a cost-effective real-time system control through the integration of advanced peripheral functional modules and various chip memory configurations. It also uses high-performance silicon gate CMOS EPROM and EEPROM technology. Low working power CMOS technology, wide operating temperature range, noise suppression, combined with high performance and a rich set of on-chip peripherals, makes the TMS370C series microcontroller applicable in automotive electronics, industrial motor control, computers, communications, and consumer electronics.
STM32 Microcontroller
The STM32 series microcontroller launched by ST is well-known among industry friends for its high cost-performance ratio, and it is arguably the best in this regard, with powerful functionality. It is based on the ARM Cortex-M core designed for high-performance, low-cost, low-power embedded applications, and has top-notch peripherals: 1μs dual 12-bit ADC, 4 megabits/second UART, 18 megabits/second SPI, etc., showing impressive performance in power consumption and integration. Of course, compared to the MSP430’s power consumption, it is slightly inferior, but this does not affect engineers’ enthusiasm for it; due to its simple structure and easy-to-use tools combined with its powerful functionality, it is well-known in the industry… its strong functionality is mainly reflected in:
Characteristics:
1. Core: ARM 32-bit Cortex-M3 CPU, maximum operating frequency of 72MHz, 1.25 DMIPS/MHz, single-cycle multiplication and hardware division.
2. Memory: On-chip integrated Flash memory ranging from 32-512KB. 6-64KB SRAM memory.
3. Clock, reset, and power management: 2.0-3.6V power supply and I/O interface driving voltage. POR, PDR, and programmable voltage detectors (PVD). 4-16MHz crystal oscillator. On-chip calibrated 8MHz RC oscillation circuit before leaving the factory. Internal 40 kHz RC oscillation circuit. PLL for CPU clock. 32kHz crystal oscillator calibrated for RTC.
4. Debugging mode: Serial debugging (SWD) and JTAG interface. Up to 112 fast I/O ports, up to 11 timers, and up to 13 communication interfaces.
Most used devices: STM32F103 series, STM32 L1 series, STM32W series
PIC Microcontroller
The PIC microcontroller series is a product of Microchip Technology, divided into three levels: basic, mid-range, and high-end, and is one of the fastest-growing microcontrollers in the current market. Its CPU adopts a RISC architecture, with 33, 35, and 58 instructions, belonging to a reduced instruction set, while employing a Harvard dual-bus structure that allows for fast operation. It enables parallel processing of program memory access and data memory access. This pipelined instruction structure allows two tasks to be completed in one cycle: executing an instruction and fetching the next instruction from program memory, which is one reason for its high efficiency. Additionally, the PIC microcontroller has become popular due to the following features:
Features:
1. Low operating voltage, low power consumption, and strong driving capability. The I/O ports of the PIC series microcontroller are bidirectional, with its output circuit being a CMOS complementary push-pull output circuit. The I/O pins have added direction registers for setting input or output states, solving the issue of the 51 series I/O pins being both input and output when at high levels.
2. When set to 1, the pin is in input state, and regardless of whether it is high or low, it is in a high-impedance state; when set to 0, it is in output state, and regardless of the level, it is in a low-resistance state, with considerable driving capability, allowing for a low-level current of 25mA and a high-level output current of 20mA. This is a significant advantage compared to the 51 series.
3. It can directly drive seven-segment displays with a simple external circuit. Its A/D is 10 bits, meeting precision requirements. It has online debugging and programming (ISP) capabilities.
Disadvantages:
Its special function registers (SFR) are not all concentrated in a fixed address range (80-FFH) like the 51 series but are dispersed across four address ranges. Only five special registers (PCL, STATUS, FSR, PCLATH, INTCON) appear simultaneously in the four storage bodies, but during programming, it is necessary to deal with special registers repeatedly, requiring setting or clearing the sixth bit (RP1) and fifth bit (RP0) of the status register STATUS. Data transfer and logical operations generally need to be performed through the working register W (equivalent to the accumulator A in the 51 series), while the 51 series can transfer directly between registers, resulting in a more pronounced bottleneck phenomenon in the PIC microcontroller compared to the 51 series, which programmers should be well aware of.
Most used devices: PIC16F873, PIC16F877
AVR Microcontroller
The AVR microcontroller is a relatively novel microcontroller introduced by Atmel, characterized by high performance, high speed, and low power consumption. It eliminates machine cycles, using clock cycles as instruction cycles and implementing pipelined operations. The AVR microcontroller’s instructions are word-based, and most instructions are single-cycle instructions. A single cycle can execute the function of the current instruction while also fetching the next instruction. Typically, the clock frequency is 4-8MHz, making the shortest instruction execution time 250-125ns. The AVR microcontroller has remained popular for its main features:
Features:
1. The AVR series does not have a structure similar to accumulator A; it primarily uses registers R16-R31 to perform A’s functions. In AVR, there is no data pointer DPTR like in the 51 series; instead, three 16-bit registers (X, Y, Z) are used to achieve the functionality of data pointers (equivalent to having three DPTRs), allowing for post-increment or pre-decrement operations. In the 51 series, all logical operations must be performed in A; however, AVR can perform operations between any two registers, saving the back-and-forth operations in A, making it superior to the 51 series.
2. The special registers of AVR are concentrated in the address range 00-3F, eliminating the need for the selection process like in PIC, making it more convenient to use. The internal RAM address range is 0-00DF (AT90S2313) and 0060-025F (AT90S8515, AT90S8535), occupying the address space for data, and these internal RAMs typically do not possess the functionality of general-purpose registers. When programs become complex, the general-purpose registers R0-R31 may become insufficient; in contrast, the 51 series has up to 128 general-purpose registers (four times that of AVR), so this feeling does not arise during programming.
3. The I/O pins of AVR are similar to PIC, with direction registers used to control input or output states. In output mode, the high-level output current is around 10mA, and the low-level input current is 20mA. Although this is not as good as PIC, it is still better than the 51 series.
Disadvantages:
1. There are no bit operations; control and judgment of related register bits are done in byte form.
2. There is a significant difference in the writing style of C language between AVR and 51, which may be uncomfortable for those starting with the 51 microcontroller.
3. There are a total of 32 general-purpose registers (R0-R31), and the first 16 registers (R0-R15) cannot directly interact with immediate numbers, thus reducing generality. In the 51 series, all general-purpose registers (address 00-7FH) can directly interact with immediate numbers, which is clearly superior.
Most used devices: ATUC64L3U, ATxmega64A1U, AT90S8515
STC Microcontroller
When mentioning STC microcontrollers, some may argue that STC can also be considered mainstream, but it is relatively good among domestic microcontrollers. The STC microcontroller is a single-clock/machine cycle microcontroller produced by Hongjing, essentially a combination of 51 and AVR. Some say that AVR is a replacement for the 51 microcontroller, but there are significant differences in bit control and C language writing style. The STC microcontroller effectively combines the advantages of both 51 and AVR; although its functionality is not as strong as AVR, it essentially has all the functionalities found in AVR, while being based on the 51 core, which greatly facilitates engineers who are familiar with the 51 microcontroller, saving time in learning AVR while not losing out on its various functionalities…
STC microcontrollers are a new generation of high-speed, low-power, and strong anti-interference 8051 microcontrollers, with instruction codes fully compatible with traditional 8051 but operating 8-12 times faster, integrating a MAX810 dedicated reset circuit. It features 4 PWM channels and 8 high-speed 10-bit A/D conversions, targeting motor control suppliers in high-interference scenarios, becoming a brand new series of microcontrollers following the 51 microcontroller…
Characteristics:
1. Downloading and burning programs via the serial port is convenient and user-friendly, with plenty of learning materials and videos available; the most famous is probably Mr. Du’s video, through which many friends interested in microcontrollers have started learning. It also features a wide voltage range: 5.5-3.8V, 2.4-3.8V, and a low-power design: idle mode, power-down mode (can be awakened by external interrupts).
2. The STC microcontroller is relatively easy to program and debug; it has 10-bit AD, internal EEPROM, and can operate at 1T/machine cycle, making it 8-12 times faster than traditional 51 microcontrollers, and is also quite affordable.
3. It has 4 capture/compare units, with the STC12C2052AD series providing 2 channels, and can also implement 4 timers or 4 external interrupts, along with 2 hardware 16-bit timers, compatible with ordinary 8051 timers. The 4-channel PCA can also implement 4 timers, featuring a hardware watchdog, high-speed SPI communication ports, full-duplex asynchronous serial ports, and is compatible with ordinary 8051 serial ports, all while having an advanced instruction set architecture compatible with the ordinary 8051 instruction set.
PS: Although the STC microcontroller’s functionality is not as powerful as AVR or STM32 and its price is not as low as 51 and STM32, these are not critical; what matters is that it is one of the better domestic microcontrollers, and I hope domestic microcontrollers can thrive…
Most used devices: STC12C2052AD
Freescale Microcontroller
Mainly targeting S08 and S12 microcontrollers, of course, Freescale microcontrollers are far from limited to these. The Freescale series microcontrollers adopt Harvard architecture and pipelined instruction structure, demonstrating low cost and high performance in many fields, and their architecture saves a lot of time in product development. Additionally, Freescale provides various integrated modules and bus interfaces, allowing for flexible application in different systems! The unique features of Freescale microcontrollers are as follows:
1. Full range: From low-end to high-end, from 8-bit to 32-bit, the full range is available, with the 8-bit/32-bit pin-compatible QE128 allowing for direct migration from 8-bit to 32-bit, filling a gap in the microcontroller industry’s 8/32-bit compatibility architecture.
2. Multiple system clock modules: Three modules, seven working modes. Various clock source input options; different MCUs have different clock generation mechanisms, which can be RC oscillators, external clocks, or crystals, and can also be internal clocks. Most CPUs have all three modules! They can operate in seven working modes: FEI, FEE, FBI, FBILP, FBE, FBELP, and STOP.
3. Multiple communication module interfaces: Freescale microcontrollers almost universally integrate various communication interface modules: including serial communication interface modules (SCI), multi-master I2C bus modules, serial peripheral interface modules (SPI), MSCAN08 controller modules, and universal serial bus modules (USB/PS2).
4. More optional modules: Features LCD driver modules, temperature sensors, ultra-high frequency transmission modules, synchronous processor modules, and some MCUs with screen display modules (OSD). A few MCUs even have ringing detection modules (RING) and dual-tone multi-frequency/tone generator modules (DMG).
5. High reliability, strong anti-interference, and various pin counts and packaging options.
6. Low power consumption; while the power consumption of Freescale series microcontrollers may not be as low as that of MSP430, they feature full-static “wait” and “stop” modes, reducing overall power consumption! Recent ultra-low power models have been comparable to MSP430!
Most used devices: MC9S12G series
If one really has to rank these microcontrollers, then if you want to follow the crowd, the 51 microcontroller is undoubtedly the first choice; if you seek ultra-high cost-performance ratio, STM32 will be your ideal choice; if you desire ultra-low power consumption, MSP430 will surely not disappoint you; if you wish to support domestic products, STC will excite you…
-END-