A brief discussion on the four major misunderstandings in learning 51 single-chip microcomputers

Publisher:bobojrtLatest update time:2021-04-28 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

When we studied microcontroller courses at the undergraduate level, the school and teachers generally asked us to start with the 51 microcontroller. When visiting technical forums related to electronics, I always see many friends discussing the 51 microcontroller. Some say that the 51 microcontroller should be learned because it is the foundation (the same as what the school does); others say that the 51 microcontroller is an outdated product and is no longer used in product applications, so there is no need to learn it. I started with the initial 51 microcontroller, and after working for many years, I now basically use 32-bit MCUs for projects. I think it's time to say goodbye to the 51 microcontroller.


The glorious past of 51 single chip microcomputer


51 single-chip microcomputer refers to MCS-51 series single-chip microcomputer, CICS instruction set. Developed by Intel, its structure adds instructions such as multiplication (MUL), division (DIV), subtraction (SUBB), comparison (CMP), 16-bit data pointer, Boolean algebra operations, as well as serial communication capabilities and 5 interrupt sources, with 128 RAM units and 4K ROM. Its representative model is ATMEL's AT89 series, which is widely used in industrial measurement and control systems. At present, the domestic 51 single-chip microcomputer market is mainly dominated by the domestic Hongjing product STC series, which is known for its low power consumption, stability and low cost.


Misunderstandings in Learning 51 Single Chip Microcomputer


Myth 1: 51 MCU is the basis of learning


The statement "51 single-chip microcomputer is the foundation of learning" is not wrong in itself. When I was an undergraduate, it was undoubtedly the foundation of learning - after all, there were no more advanced single-chip microcomputers available at that time, and there were no more advanced textbooks for reference in China. The level of teachers was also uneven, and the 51 single-chip microcomputer met such needs. Not only did it have a large number of established textbooks and extensive examples, but the actual projects at work at that time were also mainly 51 single-chip microcomputers. Therefore, the 51 single-chip microcomputer naturally became the basis of learning at that time. You should know that when I was an undergraduate in 2004, it was 10 years ago. According to Moore's Law, the electronics industry is updated every 18 months, and the technology 10 years ago has now been updated 6 generations - this is indeed the case.


At present, various tutorials for 32-bit Crtex-M series microcontrollers have become popular, and the difficulty of learning them is constantly decreasing. For example, STMicroelectronics' STM32F series microcontrollers gave away a large number of core boards in the early stage of product promotion. The free core board not only has the popular 32-bit Cortex-M series microprocessor, but also integrates an online debugger on the board. The CD or link that comes with it provides a large number of sample source codes. We only need to install the development environment to directly compile and download the debugging. At this time, it is definitely inappropriate to say that the 51 microcontroller is the basis for learning embedded systems.


Myth 2: 51 MCU can learn register operations


There is no doubt that the 51 MCU can learn to operate registers. Let's analyze the deeper reasons. In the programming environment of the MSC-51 MCU, assembly language was initially used as the main programming language. You should know that assembly language directly operates registers, and assembly language cannot do function calls and encapsulation like C language. If the 51 MCU's advantage is to operate registers, I think it should be said that the 51 MCU's operation of registers is a kind of helplessness, and it is a multiple-choice question with only one option.


Is it impossible to learn registers in our current Cortex-M series microcontrollers? Obviously not. In hardware design, the operation mode of hardware is the operation of registers, but its implementation can be different. The C language library function package provided by each microprocessor is actually the encapsulation of the instructions for operating registers in the C language environment. Here we use the ST official library function to give an example:


void USART_Init (USART1, *USART_InitStruct); //Initialize serial port 1, simple and clear, no comments required


I would also like to give an example here to illustrate the steps of register operation, but register operation is too complicated and I don’t want to waste time sorting it out.


The easy-to-understand C language, the easy-to-port C language, and the compiler corresponding to the hardware platform can complete the hardware operation. With a simple and convenient way, why should we consider the cumbersome and complicated assembly language and register operation?


Myth 3: The cost of 51 MCU is low


Cost is the main factor affecting application. The main consideration for project establishment is cost, and the main consideration for sales pricing is cost. Only low-cost solutions will have an advantage in the market. However, is the 51 microcontroller really the lowest cost? No. Now according to the functional classification, the cost of some Cortex-m0 series 32-bit microcontrollers can also be 3 yuan. Its performance is several times that of the 51 microcontroller, and it is easier to develop and maintain.


There is another cost: the cost of development difficulty. The 51 single-chip microcomputer does not support online debugging. Some problems are not found in the early stage of programming, and they will only appear after connecting to the hardware, such as the delay often used in control operations. At this time, the huge advantage of online debugging is reflected. It can extremely conveniently view the current state of the microprocessor, making the analysis of the problem simple and transparent. Thus, the difficulty of development is effectively reduced, the development cycle is shortened, and development funds are saved.



Myth 4: Getting started with 51 MCU is easy


Is it easy to get started with the 51 MCU? The author has reservations about this view. To get started with the 51 MCU, you must not only be familiar with the peripherals of the MCU, but also fully understand the meaning of a certain bit of the register. You must be familiar with the configuration of the clock and timer. This will undoubtedly increase the difficulty of learning and the familiarity period. If we use the library function mode of the 32-bit MCU, we only need to have knowledge of the C language, understand the API function, and directly look at the meaning of the annotated registers. There is no need to understand its underlying hardware implementation, let alone the meaning of a certain bit of a register. In this way, the workload is reduced, thereby reducing the difficulty of development. Do you think it is easier to get started with the 51 MCU or the 32-bit Cortex core microprocessor?


Summarize


Learning embedded systems is a very boring and challenging thing. Because it is directly connected to the actual hardware, we must not only consider the correctness of the programming, but also the reliability of the hardware. At this time, simple and efficient software writing will indirectly reduce our development difficulty and risk. The 51 single-chip microcomputer is already a thing of the past, and looking forward is the development. It's time to say goodbye to the 51 single-chip microcomputer!


Reference address:A brief discussion on the four major misunderstandings in learning 51 single-chip microcomputers

Previous article:51 MCU read and write 2G SD card program
Next article:Microcontroller Design Tips: How to Implement 8051 Modular Programming

Recommended ReadingLatest update time:2024-11-16 11:40

GigaDevice's Jin Guangyi: GD32 MCU continues to build an IoT smart development platform
Recently, the "IAIC Internet of Things Summit Forum and China Chip Application Innovation Design Competition Internet of Things Special Competition" was successfully held, hosted by China Electronics Information Industry Group Co., Ltd., guided by Wenzhou Economic and Technological Development Zone Management Committe
[Internet of Things]
GigaDevice's Jin Guangyi: GD32 MCU continues to build an IoT smart development platform
51 MCU Basics of IoT 03 - Independent Buttons
Preface In the previous section, we completed the 51 single-chip microcomputer to control LED lights and achieved the effect of flowing lights. In this section, we will learn to operate independent buttons and use two buttons to turn on and off all LED lights respectively. Buttons are very common as input devices in t
[Microcontroller]
51 MCU Basics of IoT 03 - Independent Buttons
Some habits of microcontroller programming
For some state sets, use enum instead of #define to define as much as possible. For example: enum {OFF = 0, ON = 1}; is much better than #define OFF 0 #define ON 1. The two ways of writing have the same compilation effect, but the feeling is different for the programmer and the programmer. When using enu
[Microcontroller]
Single chip ultrasonic distance measurement program
Microcontroller Ultrasonic Module Description (HC-SR04)   P10, P11, P12 are bit selections, and are displayed using common anode digital tubes. Accurate to CM level. tring is the transmission control, and this program defines it as P20 pin. echo is connected to external interrupt 0. #include reg52.h     
[Microcontroller]
Single chip ultrasonic distance measurement program
Solve the problem of being unable to read and write due to wrong fuse position during AVR microcontroller programming
In the process of burning AVR microcontrollers, it is inevitable that the fuse position is wrong, and the result is that the AVR microcontroller cannot be read or written! What should we do at this time? Throw away the expensive chip and use a new one. In fact, this is generally unnecessary. The reason why the microco
[Microcontroller]
Solve the problem of being unable to read and write due to wrong fuse position during AVR microcontroller programming
It is also possible to use C language to design the game of greedy snake in single chip microcomputer
In the MCU, I used to see that the seniors used assembly or FPGA language to write Snake. Then I was thinking, C language is the simplest language. Why not write it in C language? First of all, we must know. When designing MCU games. We must know the concept of game design. For most MCU + LCD game designs, the basic fr
[Microcontroller]
It is also possible to use C language to design the game of greedy snake in single chip microcomputer
Microcontroller IO port design skills
1. IO input design skills 01: Resistor or capacitor positions should be reserved on lines that are prone to ESD intrusion, such as key input ports. If necessary, components should be added to enhance the system's ESD resistance; 02: Set the internal pull-up resistor of the chip to prevent signal detection errors when
[Microcontroller]
I2C bus read and write driver based on AT2402 microcontroller
//This part is the driver of AT2402 using I2C bus connection #include Function.h   // AT2402 function   //Send multi-byte data function to a sub-address device               //Function prototype: bit ISendStr(UCHAR sla,UCHAR suba,ucahr /s,UCHAR no);  //Function: From starting the bus to sending address, su
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号