If the type of single-chip microcomputer is selected properly, the application system of single-chip microcomputer is economical and reliable; otherwise, it is easy to cause high expenses and system performance cannot meet the requirements.
Therefore, by mastering and correctly using the selection principle of single-chip microcomputer, you can choose the single-chip microcomputer that is most suitable for the application system, and ensure that the single-chip microcomputer application system has the highest reliability, the best performance-price ratio, the longest service life and the best upgrade. 's plan.
1. Demand research
Before choosing a model, first understand your needs and know what functions you need. Specifically, it is to determine the hardware functions of the circuit board, such as CAN, RS232, RS485, network port, USB communication, etc., the specific number of IO ports, the specific type of serial screen, LCD screen, onboard FLASH, SD, audio output, etc.
2. Performance
How to choose a single-chip microcomputer, the first and most important point is to consider the functional requirements, that is, what the design object is, what kind of task to complete, and then decide what kind of single-chip microcomputer to choose according to the complexity of the design task.
There are many factors to consider in the performance of the microcontroller, such as the number and priority of interrupt sources, operating temperature range, whether there is a low voltage detection function, whether there is a clock oscillator inside the microcontroller, whether there is a power-on reset function, etc.
3. Memory
The memory of the microcontroller can be divided into program memory (ROM) and data memory (RAM).
Program memory is specially used to store programs and constants, and there are MASK, ROM, OTPROM, EPROM, FlashROM and other types. The program memory in the form of MASK is suitable for mature and mass-produced products. For example, the single-chip microcomputer used in home appliances such as color TVs adopts this method. As long as the user sends the application code to the semiconductor manufacturer, the corresponding When the microcontroller is used, the program is solidified into the chip. Once the chip is produced, the program cannot be changed.
The single-chip microcomputer using EPROM has the advantage of flexibly modifying the program, but has the disadvantage of requiring ultraviolet erasure and time-consuming. In the research and development stage of self-test or prototype, it is recommended to use Flash single-chip microcomputer. It has the advantages of electrical writing and electrical erasing, which makes it very convenient to modify the program and can improve the development speed. For products that are beginning to take shape, OTP single-chip microcomputer can be used, which can not only eliminate the long mask time of products, speed up the time to market of products, but also facilitate the modification of programs, and can adjust and upgrade products in time.
The capacity of the program memory can be determined according to the size of the program. For 8-bit microcontroller, the maximum capacity of the on-chip program memory can reach 64KB, and it can be expanded when it is not enough. When selecting, the capacity of the program memory should only be enough, otherwise the cost will be increased.
Data memory stores temporary data during program operation, and the data is lost after power failure. Now some models of microcontrollers provide EEPROM, which can be used to store key data that needs to be protected after power failure, such as some system setting parameters.
4. Running speed
The running speed of the single-chip microcomputer first depends on the clock frequency. Generally speaking, for the single-chip microcomputer of the same structure, the higher the clock frequency, the faster the speed.
Secondly, look at the structure of the single-chip CPU; using the CISC structure (centralized instruction set) is slower than using the RISC structure (reduced instruction set). It is a single-chip microcomputer with the same structure and the same clock frequency, and sometimes the speed is different. For example, the 51 single-chip microcomputer of the W77 series of Winbond (Winbond) company only needs 4 clock cycles per machine cycle, while the general 51 single-chip microcomputer has one cycle. is 12 clock cycles, the former is 3 times faster than the latter.
When choosing a single-chip microcomputer, it is necessary to select the speed according to the needs, and do not one-sidedly pursue high speed. The parameters such as the stability and anti-interference of the single-chip microcomputer are basically inversely proportional to the speed, and the fast speed also consumes a lot of power.
5. I/O (input/output) port
The number and function of I/O ports are one of the first issues to be considered when selecting a single-chip microcomputer. The number of I/O ports should be determined according to actual needs. The excess I/O ports will not only increase the size of the chip, but also increase the cost. The drive capability of the I/O port should also be considered when selecting. A single-chip microcomputer with a large drive current can simplify the peripheral circuit.
51 series of microcontrollers have a large drive current when they are pulled down (output low level), but are small when they are pulled up (output high level). On the other hand, each I/O port of PIC and AVR series microcontrollers can set the direction. When the output port is used, it outputs high and low levels in a push-pull drive mode. The drive capability is strong, and it also makes the I/O port resources flexible and functional. Powerful and fully exploitable. Of course, we can also design peripheral circuits according to the function of the I/O port. For example, using 51 single-chip microcomputer to drive the nixie tube, we can use the common anode nixie tube to exert the characteristics of large pull-down driving current of its output port.
6. Timer/Counter (I/O)
Most microcontrollers provide 2 to 3 timers/counters and also have input capture, output comparison and PWM (pulse width modulation) functions, such as AVR microcontrollers. Some microcontrollers also have specialized PCA (programmable counter array) modules and CCP (input capture/output compare/PWM) modules, such as PIC and some mid-to-high-end microcontrollers from Philips. Using these modules can not only simplify the software design, but also occupy less CPU resources.
There are still many microcontrollers that provide a watchdog timer (WDT), which can be reset when the microcontroller "crashes".
When choosing, you can choose according to your own needs and programming requirements. Don't one-sidedly pursue multiple functions. Unused functions are equivalent to a waste of money.
7. Serial interface
Common serial interfaces of single-chip microcomputer include: standard UART interface, enhanced UART interface, I2C bus interface, CAN bus interface, SPI interface, USB interface, etc. Most microcontrollers have a serial interface. In the absence of special instructions, the serial interface we often say, referred to as the serial port, refers to the UART.
If the system only uses one single-chip microcomputer chip, the UART interface or USB interface is usually used to communicate with the computer or other chips, and can not be used when there is no need to communicate with other devices/chips.
The SPI interface can be used for ISP programming. When you do not have a programmer, try to use a microcontroller with this interface. Of course, the SPI interface can also be used for high-speed serial communication with other peripherals.
I2C bus is a two-wire, bidirectional, synchronous bus that can be operated by multiple hosts. IC bus is an industrial standard and is widely used in various electronic products. For example, current color TVs use IC bus to set parameters. . The microcontroller with IC bus interface can simplify programming when using serial EEPROM such as AT24C01.
Usually the most used is the UART interface, other interfaces can be selected according to your needs.
8. Analog circuit function
Many microcontrollers now provide A/D converters, PWM outputs and voltage comparators, and a small number of microcontrollers provide D/A converters. While integrating the on-chip A/D converter, the single-chip microcomputer also integrates a sampling/holding circuit, which makes it easy for users to build a precise data acquisition system.
The PWM output module can be used to generate pulse signals of different frequencies and duty cycles. The D/A output function can be easily realized by using the PWM output module and the RC filter circuit. The PWM output module can also be used to realize functions such as speed regulation of DC motors.
The voltage comparator integrated in the microcontroller can realize a variety of functions, such as threshold detection, low-cost A/D converter and so on.
9. Working voltage and power consumption
The working voltage of the single-chip microcomputer can reach 1.8V at the lowest and 6V at the highest. The commonly used single-chip working voltage is 4.5V~5.5V, and the low-voltage series is 2.7V~5.0V or 2.4V~3.6V. The selection is determined according to the power supply mode.
The power consumption parameters of the microcontroller mainly refer to the working current in normal mode, idle mode, and power-down mode. For systems powered by batteries, products with low current should be selected. At the same time, it is necessary to consider whether to use the power-down mode of the microcontroller. If so, a microcontroller with corresponding functions must be selected.
10. Package form
The common package forms of single-chip microcomputer are: DIP (dual in-line package), PLCC (PLCC should correspond to socket), QFP (quad-pin flat package), SOP (dual-line small outline chip package) and so on.
When doing experiments, DIP packages are generally used. If other packages are used, special adapters are also provided when programming with a programmer. If there is a requirement for the volume of the system, such as the single-chip microcomputer used in the remote control, QFP and SOP packages are often used.
11. Anti-interference performance, confidentiality
When choosing a single-chip microcomputer, it is necessary to choose a good anti-interference performance, especially if it is used in an industrial environment with relatively large interference. The confidentiality performance after the encryption of the single-chip microcomputer should also be good, which can ensure that your intellectual property rights are not easily infringed.
12. Developability of MCU
This is also a very important factor. Whether the selected single-chip microcomputer has sufficient development means directly affects whether the single-chip microcomputer can be successfully developed and the speed of development. For the selected microcontroller, the following issues should be considered.
13. Development tools, programmers
Is there an integrated development environment, whether it supports C language while supporting assembly language, using C language can speed up your development progress, and C language has good portability.
Does the microcontroller you choose have programmer support, or whether it can be programmed by ISP.
14. Development cost
Whether the price of the programmer and emulator corresponding to the microcontroller you choose is high, and whether to use special equipment. For example, sometimes the microcontroller needs to use a dedicated programmer, so your development cost will be high.
15. Applicability of developers
This is also a very practical problem. If there are two kinds of microcontrollers that can solve the problem, of course, choose a variety you are familiar with. In most cases, people tend to give priority to choosing 51 or STM32 series microcontrollers.
Generally, the less popular Renesas microcontrollers like the ones used by the editor are not used. In addition to the lack of rich development materials, the technical support services of the manufacturers are not strong enough.
16. Technical support and service
Technical support and services can be considered from the following aspects.
1. Is the technology mature?
You can use it with confidence after a lot of use has proven to be a mature product.
2. Is there any technical service
Whether there are domestic agents and corresponding technical support, and whether the information provided by the website is rich, including chip manuals, application guides, design schemes, sample programs, etc.
17. The purchasability of single-chip microcomputers
Whether the single-chip microcomputer can be purchased directly refers to whether the single-chip microcomputer can be directly purchased from the manufacturer or its agent, and whether the purchase path is smooth. Whether the single-chip microcomputer has sufficient supply to ensure that the selected single-chip computer can meet the production needs of the product.
When choosing a single-chip microcomputer, you should also pay attention to selecting those models that are still in production. The discontinued single-chip microcomputer cannot be used because it has no follow-up supply capacity, which directly affects the continued production and vitality of the product. At the same time, it will also give a sense of outdated, thereby affecting the novelty of the product.
It is best to also look at whether the selected single-chip microcomputer is being improved. Obviously, for the single-chip microcomputer that is ready to launch a new version or has a new version, the choice for application systems or products has strong stamina.
18. Product price
This is also an important factor. Under other conditions, of course, choose products with low prices, which can improve the cost performance.
Summary
By selecting the single-chip microcomputer according to the above principles, you can choose the single-chip microcomputer that is most suitable for your application system, so as to ensure that the application system has the highest reliability, the best cost performance, the longest service life and the best upgradeability.