A microcontroller is an integrated circuit chip that features a processor core, memory, input/output interfaces, and various peripherals. Microcontroller is short for single-chip microcomputer, and MCU stands for Microcontroller, which is an embedded microcontroller. It is one of the most commonly used and essential components in embedded systems. Unlike general-purpose computers, microcontrollers are typically used to control and execute specific tasks, such as controlling home appliances, automotive electronic systems, medical equipment, industrial automation, and various embedded applications.
Selecting a microcontroller is an important and time-consuming task. A suitable microcontroller model will result in an economical and reliable microcontroller application system. An unsuitable model, however, can lead to economic waste, disrupt the normal operation of the microcontroller application system, and even prevent it from achieving its intended functions.
For a pre-designed microcontroller application system, its technical requirements and system functions should be clearly defined. If a microcontroller with too few functions is chosen, the application system will be unable to complete the control tasks. If an overly powerful microcontroller is chosen, it is not only unnecessary but also wastes resources and results in low cost-effectiveness.
By mastering and applying the principles of correct microcontroller selection, one can choose the microcontroller best suited for the application system, ensuring that the microcontroller application system has the highest reliability, the best performance-price ratio, the longest service life, and the best upgrade and replacement possibilities.
The general principle for selecting a microcontroller chip is:
(Use) chips to complete (with minimal external components)
Choose large (major manufacturers) over small ones; choose those with abundant supply over those with limited supply.
Choose a reputable brand, not a vague or unknown factory.
Choose something inexpensive but of good quality.
In the event of a chip shortage, prioritize microcontrollers with ample supply.
When selecting a microcontroller, the main considerations are the technicality, practicality, and developability of the microcontroller application system.
Technical aspects. The selection of a microcontroller chip should be based on its technical specifications to ensure the reliable operation of the microcontroller application system under certain technical conditions.
Practicality. When selecting a microcontroller manufacturer, factors such as the supplier's channels and reputation should be considered to ensure the long-term, reliable operation of the microcontroller application system.
Developability. The selected microcontroller should have reliable development capabilities, such as program development tools and simulation debugging methods.
Discussion on Microcontroller Selection
For a long time, there have always been various discussions about microcontrollers: "This one is no good," "That one is no good," "That one is outdated," "This one is advanced," "Learning this or that one is useless."
All I want to say is to use the right chip to make the right product, and to focus our efforts on design and excellent ideas.
Don't get bogged down in the details of chips. Focus your valuable energy on the expertise you have in developing your products. Arguing about the advancement of chips or personal feelings is meaningless. Of course, new technologies will naturally lead to new products.
As for which chip to choose, that depends on your product. For beginners, no matter what new product you're learning, you should learn it well and be able to use it flexibly to meet the product's requirements. That's a good thing; nothing you learn is ever wasted.
A microcontroller is ultimately just a tool; true skill lies in your professional knowledge.
Perhaps my example is not very appropriate, but the key point is to tell newcomers to study diligently and not to be confused by the debate about which microcontroller to use. Everyone's thinking is different, and the fields of application will also be different in the future.
Of course, the understanding of each chip will be different. Just choose the one that suits you, thoroughly understand it, and in retrospect, they are all the same, just different tools. Don't talk about how good or bad it is to learn 51, STM32, or ARM.
Regardless of which one, they are all tools for realizing your ideas.
Use whatever feels convenient and practical, learn it well, and become familiar with it. Don't use whatever sounds good today, or use whatever someone says is good tomorrow. New things are always emerging, every day, and they're all good things. Can you learn them all at once?
It's better to find something that suits you and learn it well first. It will be much easier to learn other things in the future.
The ability to apply knowledge to different situations is a valuable lesson learned from someone who has been through it all.
This insight may only be shared by 50% of people in this industry, so let's share it with those 50% of friends.
▼ In practical applications, how do you choose the type of microcontroller?
Selection principles: The selection of a microcontroller mainly considers several aspects such as instruction structure, running speed, program storage method, and functions.
I've read some articles discussing which microcontroller is the best.
In my opinion, choosing a suitable microcontroller is sometimes quite difficult, as there are too many factors to consider. It's possible to say that a particular MCU is suitable for a specific application; it's unlikely that a single brand of MCU is suitable for all designs. If such a brand existed, that would be fantastic.
(1) Basic parameters of a microcontroller, such as speed, program memory capacity, and number of I/O pins.
(2) Enhanced functions of the microcontroller. For example, watchdog timer, dual pointers, dual serial ports, RTC (real-time clock), EEPROM, extended RAM, CAN interface, I2C interface, SPI interface, and USB interface.
(3) Compared with OTP (One-Time Programmable), Flash is the best.
(4) Packaging. DIP (Dual In-line Package), PLCC (PLCC has a corresponding socket), or surface mount. DIP packaging may be more convenient when conducting experiments.
(5) Operating temperature range. Industrial or commercial grade. If designing outdoor products, industrial grade must be selected.
(6) Power consumption. For example, when designing a parallel port dongle, the power supply from the signal line can only provide a few mA.
(7) Operating voltage range. For example, when designing a TV remote control powered by two dry batteries, it should be able to operate within a voltage range of at least 1.8~3.6V.
(8) Smooth supply channels. Able to apply for samples and make small-batch purchases of products in stock.
(9) Low price.
(10) There are service providers who provide a lot of useful technical support, and at least there are places to buy programmers.
(11) Low price of programmers. If it is ICP (programming the microcontroller on the programmer), can an existing programmer be used? If it is a surface mount package, buying an adapter is also very expensive, at least one or two hundred yuan. Can IS (in-system programming, i.e., the chip is first soldered onto the board and then programmed through the reserved ISP interface) be used? Generally, ISP programmers are cheaper, about one or two hundred yuan or even tens of yuan.
(12) Emulators are inexpensive. For FLASH microcontrollers, emulators are not essential. However, for OTP (One-Time Programmable) microcontrollers, emulators must be purchased or rented.
(13) The microcontroller language is one that I am familiar with and that supports C language. The programming environment should be as easy to use as Keil and free.
(14) The website is fast and has abundant information, including chip manuals, application guides, design schemes, and sample programs. It is best if it is in Chinese, like Atmel.
(15) Good security. Check the blacklist on professional decryption websites, and then send an email to inquire about decryption prices.
(16) Good anti-interference performance.
(17) Consideration of other peripheral chips, including circuit principles, analog electronics, digital electronics, communication principles, microcontrollers, high-frequency electronic circuits, signal systems, digital signal processing, FPGA, DSP, etc.
How to select a microcontroller
Several key factors can help you make a decision when choosing a microcontroller. Here are some suggestions:
Functional Requirements: First, determine the functional requirements of your project or application. Microcontrollers come in various types and specifications, with different functions and characteristics. Ensure you understand the processing power, storage capacity, input/output interfaces, communication protocols, and other requirements of your application.
Architecture: Choose a microcontroller architecture that suits your project needs. Common architectures include CISC (Complex Instruction Set Computer) based microcontrollers (such as 8051, AVR, etc.) and RISC (Reduced Instruction Set Computer) based microcontrollers (such as ARM Cortex-M series). Each architecture has its specific advantages and uses, so you need to choose one based on your project requirements.
Performance parameters: Consider the microcontroller's performance parameters, such as clock frequency, number of processor cores, memory capacity (RAM and ROM), and number of peripherals. These parameters directly affect the microcontroller's computing and data processing capabilities, ensuring that the selected microcontroller meets your application requirements.
Development Tools and Ecosystem: Evaluate the microcontroller's development toolchain and ecosystem support. Understand the availability, ease of use, and support of the development tools, as well as related development documentation, sample code, and community support. This will have a significant impact on your development and debugging process.
Cost and Availability: Consider the cost and availability of the microcontroller. Different microcontrollers vary significantly in price depending on their functionality and performance. At the same time, ensure that the selected microcontroller is readily available and purchasable in the market to facilitate a smooth supply chain and production schedule.
Reliability and Support: Understand the reputation and technical support of the microcontroller manufacturer. Choosing a well-known, reputable manufacturer ensures reliable product quality and technical support.
Finally, it is recommended to conduct some market research and technical evaluation before selecting a microcontroller, and to consult relevant technical documents, specifications and user reviews in order to make an informed choice.