Hardware engineers must read: a detailed introduction of 7 mainstream single-chip computers
2024-05-24 16:02:43 523
Embedded concept
First of all, "embedded" is a concept, there is no exact definition, each book has its own definition. But the main idea is the same, that is, compared with the general system of the PC, the embedded system is a special system, the structure is simple, in both hardware and software, only the required part is retained, and the unnecessary part is cut out. Therefore, embedded systems generally have the characteristics of portability, low power consumption, single performance and so on.
Then, MCU, DSP, FPGA, these belong to the category of embedded systems, are tools used to achieve a certain purpose.
MCU commonly known as "MCU" after so many years of development, has not only Princeton structure 51, the performance has also been greatly improved. Because the MCU must execute the program sequentially, it is suitable for control and is more used in industry. ARM is a company specializing in the design of MCU, due to advanced technology and proper strategy, the single-chip microcomputer market share in the past two years is huge. ARM's microcontroller has many kinds, from low-end M0(small appliances) to high-end A8, A9(mobile phones, tablets) are very popular, so it is not ARM's microcontroller must be on the system, the key to see the application.
DSP is called digital signal processor, and its structure is different from MCU, speeding up the computing speed and highlighting the computing power. Think of it as a super fast MCU. Low-end DSPS, such as the C2000 series, are mainly used for motor control, but TI seems to call it DSC(Digital Signal Controller) something between MCU and DSP. High-end DSPS, such as the C5000/C6000 series, are generally used for video image processing and communication equipment, which require a large number of operations.
FPGA is called field programmable logic array, itself has no function, like a piece of white paper, want it to have what function is completely designed by the programmer (all of its processes are hardware, including VHDL and Verilog HDL programming is also a hardware category, generally called writing "logic"). . If you have enough NB, you can turn it into an MCU, or you can turn it into a DSP. Because the internal structure of MCU and DSP is designed, it can only be sequential processing through software programming, while FPGA can be parallel processing and sequential processing, so it is the fastest.
So why do MCUS, DSPS and FPGas exist at the same time? That is because the internal structure of the MCU and DSP are carefully designed by IC designers, and the power consumption and price are much lower than the FPGA when completing the same function. Moreover, the development of FPGA itself is more complex, and it takes more human and financial resources to complete the same function.
So each of the three has its own strengths, and each has its own use. However, at present, there is a trend of integration between the three, ARM's M4 series adds a simplified DSP core, TI's Da Vinci series is itself an ARM+DSP structure, and the newly launched FPGA of ALTERA and XINLIX contains ARM's core in it. So the relationship between the three is more and more like the three circles of the three primary colors.
Where does hardware engineer learning begin?
Single chip microcomputer: usually no operating system, used for simple control, such as elevators, air conditioning, etc.
dsp: Used for complex calculations, such as discrete cosine transforms and fast Fourier transforms, commonly used in image processing and used in devices such as digital cameras.
arm: A British chip design company, but does not manufacture chips. Only intellectual property.
fpga: Field programmable gate array, the circuit design completed by hardware description language (Verilog or VHDL), can be simple integration and layout, and quickly burned to the FPGA for testing, is the mainstream of modern IC design verification technology.
Embedded is relative to desktop computers, the system can be cut, different forms, may be volume, power consumption, cost constraints, high real-time requirements, such as oscilloscopes, mobile phones, tablet computers, automatic washing machines, routers, digital cameras, these devices, although you can not see the existence of desktop, but there are one or more embedded systems in the work.
Different options are provided depending on the functional complexity and computational processing complexity of the object architecture. For a simple home appliance control embedded system, the use of a simple 8-bit single-chip microcomputer is enough, cheap and fine, for mobile phones and game consoles, you must use 32-bit ARM and DSP chips. FPGA is a more hardware-oriented implementation.
So by learning to become a hardware engineer, you start with a single chip computer, and then learn ARM and DSP.
A detailed introduction of the seven major single-chip computers on the market
Single-chip microcomputer is now overwhelming, a wide variety, so that developers can not cope, the development is also quite rapid, from the 1980s, from the then 4 8-bit development to the present various high-speed single-chip microcomputer.
Various manufacturers are also in speed, memory, function one after another, uneven ~~ At the same time emerged a large number of representative microcontroller manufacturers: Atmel, TI, ST, MicroChip, ARM... The domestic macro STC microcontroller is also commendable...
The following brings you the advantages and disadvantages of 51, MSP430, TMS, STM32, PIC, AVR, STC MCU comparison and function embodiment......
51 single chip microcomputer
The most widely used 8-bit single-chip microcomputer is of course the easiest for beginners to learn the single-chip microcomputer, first launched by Intel, because of its typical structure and perfect bus special register centralized management, many logical bit operation functions and control-oriented rich instruction system, can be called a generation of "classic", for the development of other single-chip computers in the future laid the foundation.
The reason why the single chip microcomputer has become a classic and become an easy to use single chip microcomputer has the following characteristics:
Features:
1. From the internal hardware to the software, there is a complete bitwise operating system, called the bit processor, which deals with bits rather than words or bytes. It can not only process some special function registers in the chip, such as transfer, setting, clearing, testing, etc., but also carry out bit logic operations, and its functions are very complete and easy to use.
2. At the same time, a dual-function address interval is also specially opened up in the on-chip RAM interval, which is extremely flexible in use. This function undoubtedly provides great convenience to users.
3. Multiply and divide instructions, which also brings convenience to programming. Many eight-bit microcontrollers do not have the function of multiplication, multiplication also have to make up a section of subroutine call, very inconvenient.
Disadvantages: (Although it is a classic, the disadvantages are obvious)
1.AD, EEPROM and other functions need to be extended, which increases the burden of hardware and software
2. Although the I/O foot is simple to use, there is no output ability at high power times, which is also the biggest weakness of the 51 series single-chip microcomputer
3. The running speed is too slow, especially the double data pointer, if it can be improved, it can bring great convenience to programming
4.51 protection ability is very poor, it is easy to burn the chip
Scope of application:
At present, it is widely used in teaching occasions and occasions with low performance requirements
The most used devices: 8051, 80C51
MSP430 MCU
MSP430 series microcontroller is a 16-bit ultra-low power mixed-signal processor that Texas Instruments began to market in 1996, leaving the biggest highlight is low power consumption and fast, assembly language is very flexible to use, many addressing methods, few instructions, easy to get started. Mainly due to its practical application needs, many analog circuits, digital circuits and microprocessors are integrated on a chip to provide a "single chip" solution. Its rapid development and the continuous expansion of the scope of application mainly depend on the following characteristics...
Features:
1. Powerful processing power, the use of reduced instruction set (RISC) structure, with a wealth of addressing methods (7 source operand addressing, 4 destination operand addressing), simple 27 kernel instructions and a large number of analog instructions; A large number of registers and on-chip data memory can participate in various operations; There are also efficient table lookup processing instructions; It has a high processing speed, and the instruction cycle is 125 ns under the 8MHz crystal drive. These characteristics ensure that an efficient source program can be written
2. In terms of computing speed, 125ns instruction cycle can be achieved under the drive of 8MHz crystal. 16-bit data width, 125ns instruction cycle and multifunctional hardware multiplier (can achieve multiplication and addition), can implement some digital signal processing algorithms (such as FFT)
3. Ultra-low power consumption, MSP430 MCU has ultra-low power consumption, because it has its own unique features in reducing the chip's power supply voltage and flexible and controllable running clock. The power supply voltage is 1.8-3.6V. Therefore, when it runs at 1MHz clock conditions, the current of the chip will be about 200 to 400uA, and the minimum power consumption of the clock off mode is only 0.1uA
Cons:
1. Personal feeling is not easy to get started, not suitable for beginners, the information is relatively small, can only run to the official website to find
2. The instruction space is larger, because it is a 16-bit MCU, the program is in word units, and some instructions actually account for 6 bytes. Although the program is simple on the surface, it takes up a lot of space compared with pic microcontroller
Scope of application:
It is widely used in low-power and ultra-low-power industrial applications
The most used devices: MSP430F series, MSP430G2 series, MSP430L09 series
TMS microcontroller
Here also mentioned the TMS series MCU, although not mainstream. The 8-bit CMOS microcontroller introduced by TI has a variety of storage modes and peripheral interface modes, which is suitable for complex real-time control occasions. Although not as good as the STM32, nor as publicized as the MSP430, the TMS370C series of microcontrollers provides cost-effective real-time system control by integrating advanced peripheral function modules and various chip memory configurations. At the same time, high performance silicon gate CMOS EPROM and EEPROM technology are adopted. Low power consumption CMOS technology, wide operating temperature range, noise suppression, coupled with high performance and rich on-chip peripheral functions, make TMS370C series microcontroller in automotive electronics, industrial motor control, computer, communication and consumer applications.
STM32 MCU
STM32 series single-chip microcomputer launched by ST manufacturers, friends in the industry know that this is a cost-effective series of single-chip microcomputer, should not be one, the function is powerful. It is based on the ARM Cortex-M core specifically designed for embedded applications requiring high performance, low cost and low power consumption, while featuring best-in-class peripherals: 1μs dual 12-bit ADC, 4 megabits/SEC UART, 18 megabits/SEC SPI, etc., also has a good performance in terms of power consumption and integration, of course, compared with the power consumption of MSP430 is slightly inferior, but this does not affect the degree of enthusiasm of engineers for it. Because of its simple structure and easy to use tools combined with its powerful functions in the industry famous... Its powerful functions are mainly manifested in:
Features:
1. Core: ARM32 bit Cortex-M3CPU, maximum operating frequency 72MHz, 1.25DMIPS/MHz, single-cycle multiplication and hardware division
2. Memory: 32-512KB Flash memory integrated on the chip. 6-64KB SRAM memory
3. Clock, reset and power management: 2.0-3.6V power supply and drive voltage of I/O interface. POR, PDR and programmable voltage detector (PVD). 4-16MHz crystal oscillator. Built-in 8MHz RC oscillator circuit tuned before delivery. Internal 40 kHz RC oscillator circuit. PLL for CPU clock. 32kHz crystal oscillator with calibration for RTC
4, debugging mode: serial debugging (SWD) and JTAG interface. Up to 112 fast I/O ports, up to 11 timers, up to 13 communication interfaces
Most used devices: STM32F103 series, STM32 L1 series, STM32W series
PIC microcontroller
PIC Microcontroller series is the product of Microship, divided into three levels, that is, basic level, intermediate level and advanced level, is one of the fastest growing single-chip computers in the current market share, the CPU uses RISC structure, there are 33, 35, 58 instructions, belong to reduced instruction set. At the same time using Harvard double bus structure, running speed, it can make the program memory access and data memory access parallel processing, this instruction pipeline structure, in a cycle to complete two parts of the work, one is to execute instructions, the second is to take out the next instruction from the program memory, so that in general each instruction only one cycle, which is also efficient operation One of the reasons, in addition to the PIC microcontroller has become a very hot microcontroller nothing more than the following characteristics:
Features:
1. It has the characteristics of low working voltage, low power consumption and strong driving ability. The I/O port of PIC series microcontroller is bidirectional, and its output circuit is CMOS complementary push-pull output circuit. The direction register for setting the input or output state is added to the I/O pin, thus resolving the state of both input and output when the 51 Series I/O pin is on high battery.
2. When the pin is set to 1, it is in the input state. Regardless of whether the pin is high level or low level, it is in the high resistance state. When set to 0, it is the output state. No matter what level the pin is, it is in a low resistance state and has considerable driving capacity. The low level suction current can reach 25mA and the high level output current can reach 20mA. This is a big advantage over the 51 series
3. It can directly drive the nixie display and the external circuit is simple. Its A/D is 10 bits, which can meet the accuracy requirements. With online debugging and programming (ISP) function.
Shortcomings:
Its special purpose registers (SFR) are not concentrated in a fixed address interval (80 ~ FFH) as in the 51 series, but are scattered over four address intervals. Only five specialized registers, PCL, STATUS, FSR, PCLATH, and INTCON, appear simultaneously in all four memory bodies. However, in the programming process, it is necessary to deal with special registers, and repeatedly select the corresponding storage body, that is, to set or clear the sixth (RP1) and fifth (RP0) bits of the STATUS register status. Data transmission and logical operations are basically through the working register W(equivalent to 51 series accumulator A) to carry out, and 51 series can also be directly transmitted between registers, so the bottleneck phenomenon of PIC microcontroller is more serious than 51 series, which should be deeply experienced in programming friends
Most used devices: PIC16F873, PIC16F877
AVR microcontroller
AVR single chip microcomputer is a novel single chip microcomputer introduced by Atmel company, which is characterized by high performance, high speed and low power consumption. It cancels the machine cycle, takes the clock cycle as the instruction cycle, and implements pipelined operation. AVR MCU instructions are in word units, and most of the instructions are single-cycle instructions. The single cycle can execute this instruction function and complete the reading of the next instruction at the same time. Usually the clock frequency is 4 ~ 8MHz, so the shortest instruction execution time is 250 ~ 125ns. AVR single-chip microcomputer can become a relatively hot single-chip microcomputer recently, the main characteristics:
Features:
1.AVR series does not have A similar accumulator A structure, it is mainly through R16 ~ R31 registers to achieve the function of A. In AVR, there is no data pointer DPTR like 51 series, but by X(composed of R26, R27), Y(composed of R28, R29), Z(composed of R30, R31) three 16-bit registers to complete the function of the data pointer (equivalent to three groups of DPTR), and can also be used for post-increment or first-decrement operation, etc. In the 51 series, all logical operations must be performed in A; AVR, on the other hand, can run between any two registers, eliminating the need to toss back and forth in A, which is better than the 51 series
2. The special register of AVR is concentrated in the 00 ~ 3F address range, without the process of selecting the storage body like PIC, which is more convenient to use than PIC. AVR's on-chip RAM address range is 0 ~ 00DF(AT90S2313) and 0060 ~ 025F(AT90S8515, AT90S8535), they occupy the address of the data space, these on-chip RAM is only used to store data, usually does not have the function of universal register. When the program is complex, the general purpose registers R0 ~ R31 are not enough. The 51 series has up to 128 general-purpose registers (4 times the AVR), so there is no such feeling when programming.
3.AVR's I/O pin is similar to PIC, it also has a direction register used to control the input or output, in the output state, the high level output current is about 10mA, and the low level suction current is 20mA. This is not as good as the PIC, but it is still better than the 51 series...
Cons:
1. There is no bit operation, which is to control and judge the relevant register bits in the form of bytes
2. There are great differences between C language and 51 C language in writing, which makes friends who have learned 51 microcontroller from the beginning not used to it
3. There are a total of 32 general purpose registers (R0 ~ R31), and the first 16 registers (R0 ~ R15) can not directly deal with the immediate number, so the universality is reduced. In the 51 series, all its general purpose registers (addresses 00 ~ 7FH) can directly deal with immediate numbers, which is obviously better than the former.
The most used devices: ATUC64L3U, ATxmega64A1U, AT90S8515
STC microcontroller
When it comes to STC microcontroller, some people will say that STC can also be considered mainstream, it is estimated to be sprayed ~~ We based on it is a relatively good microcontroller in China. STC microcontroller is a single clock/machine cycle microcontroller produced by Macrocrystal, STC microcontroller is a combination of 51 and AVR, some people say that AVR is a replacement of 51 microcontroller, but AVR microcontroller in place control and C language writing there are great differences. STC single-chip computer combines the advantages of 51 and AVR. Although the function is not as powerful as AVR, the functions that can be found in AVR are basically available in STC. At the same time, STC single-chip computer is 51 core, which provides great convenience for engineers based on 51 single-chip computer, saving the time of learning AVR. Without losing the various functions of AVR...
STC single-chip microcomputer is a new generation of 8051 single-chip microcomputer with high speed, low power consumption and strong anti-interference, the instruction code is fully compatible with the traditional 8051, but the speed is 8 to 12 times faster, and the internal integrated MAX810 special reset circuit. 4-channel PWM 8-channel high-speed 10-bit A, D conversion, for the motor motor supplier control, strong interference occasions, become a new series of single-chip microcomputer after 51 MCU...
Features:
1. Download burning program with serial port is convenient and easy to use, easy to use, with a lot of learning materials and videos, the most famous belongs to the teacher Du's video, a lot of friends interested in single-chip microcomputer are through this video entry, while having a wide voltage: 5.5 ~ 3.8V, 2.4 ~ 3.8V, low power design: Idle mode, power off mode (can be awakened by external interruption)
2.STC microcontroller has in application programming, debugging is more convenient; With 10-bit AD, internal EEPROM, it can work at 1T/ machine cycle, the speed is 8 to 12 times that of the traditional 51 MCU, and the price is also cheaper
3.4 Channel capture/comparison unit, STC12C2052AD series is 2 channels, can also be used to implement 4 more timers or 4 external interrupts, 2 hardware 16-bit timers, compatible with the normal 8051 timer. 4-way PCA can also realize 4 timers, with hardware watchdog, high-speed SPI communication port, full-duplex asynchronous serial port, compatible with the ordinary 8051 serial port, but also with advanced instruction set structure, compatible with the ordinary 8051 instruction set
PS: Although the STC microcontroller function is not as powerful as AVR, STM32, the price is not as cheap as 51 and ST32, but these are not important, the important thing is that this belongs to the domestic microcontroller is more excellent microcontroller, I hope that the domestic microcontroller can be all the way.
Most used device: STC12C2052AD
Freescale microcontroller
Mainly for S08,S12 such microcontroller, of course, Freescale microcontroller is far from this. Freescale series single chip microcomputer adopts Harvard structure and pipeline instruction structure, which shows the characteristics of low cost and high performance in many fields. Its architecture saves a lot of time for product development. In addition, Freescale provides a variety of integrated modules and bus interfaces, which can play a more flexible role in different systems! The unique features of Freescale microcontroller are as follows:
1. Full series: from low-end to high-end, from 8 bit to 32 bit full series everything, its launch of 8 bit /32 bit pin compatible QE128, can be directly transplanted from 8 bit to 32 bit, make up for the microcontroller industry 8/32 bit compatible architecture missing a link
2. Multiple system clock modules: three modules, seven working modes. Multiple clock source input options, different MCUS have different clock generation mechanisms, can be RC oscillator, external clock or crystal oscillator, can also be internal clock, most cpus have the above three modules! Can run in FEI, FEE, FBI, FBILP, FBE, FBELP, STOP these seven working modes
3. A variety of communication module interfaces: Freescale microcontroller almost integrates a variety of communication interface modules inside: including serial communication interface module SCI, multi-master I2C bus module, serial peripheral interface module SPI, MSCAN08 controller module, universal serial bus module (USB/PS2)
4. There are more optional modules: an LCD driver module, a temperature sensor, a UHF transmission module, a synchronization processor module, an MCU containing a synchronization processor also has a screen display module OSD, and a few MCUS have a ringing detection module RING and a dual-tone multi-frequency/tone generator DMG module
5. High reliability, strong anti-interference, a variety of pin number and package options
6.Low power consumption, perhaps the Freescale series of microcontroller power consumption is not as low as MSP430, but he has a full static "wait" and "stop" two modes, from the overall reduce your power consumption! Recently launched several ultra-low power consumption has been comparable to the MSP430!
Most used devices: MC9S12G series
If you really want to be divided into one, two and three in these microcontrollers, then if you want to follow the public, it is understandable that 51 microcontrollers are still the first choice; If you pursue high cost performance, STM32 will be your ideal choice; If you crave ultra-low power consumption, the MSP430 will certainly not disappoint you; If you want to support domestic, STC will get you excited...