What is the difference between 51 microcontroller and 52 microcontroller? Is it necessary to buy a 51 emulator?

Publisher:数字奇迹Latest update time:2022-12-21 Source: zhihu Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

When we develop microcontroller programs, we often encounter no errors in compilation and check the program code repeatedly, but we can't find the problem. We don't know where the problem occurs?

At this time, the mood will be particularly irritable. The program code of the microcontroller is just letters and numbers, which is a bit abstract. Therefore, we have developed many program codes based on the technical information provided by the original chip manufacturer.

If some abstract problems arise in the microcontroller program and the problem cannot be found, it will be a very distressing thing.

How should we deal with these problems?

①Locate the problem through the flashing effect of LED. If you suspect there is a problem, use the LED effect where it is suspected.

② Find problems through serial port printing. This is the debugging method I use most during the development of 51 microcontroller programs.

③Processed through microcontroller hardware simulation

Although there are many ways to find problems, we have to admit that microcontroller hardware simulation is the most efficient and is very convenient to use.

1. What is a microcontroller emulator?

The microcontroller emulator is a tool that helps electronic engineers analyze the logic of program code operation and find problems during the product development process.

The microcontroller emulator and computer simulation software are used together.

The computer simulation software of the emulator can perform single-step tracking and debugging of the microcontroller program, and can also set breakpoints, run at full speed and other debugging methods to observe the actual running data of various variables, RAM and registers in the program code, and track the execution of the program. At the same time, real-time debugging of hardware circuits and software program logic is performed.

The microcontroller emulator can quickly help us find program errors and problems, and greatly improve our efficiency in handling abnormal operation of program code.

Especially for beginners who are not experienced in microcontroller program development, if a problem occurs during program operation, it is impossible to find the program code problem by observing the program operation with the naked eye, especially some relatively hidden problems, which are even more difficult to solve.

2. Is it necessary to buy a 51 emulator?

I have done a lot of 51 microcontroller projects, but so far, I have not used an emulator. We searched for 51 emulators on a certain website, and all that came out were ARM emulators. For a long time, we did not find a 51 microcontroller emulator. commodity.

This is because in the development of the 51 microcontroller project, there are very few software engineers using emulators, and there is basically no market. However, for the development of STM32 microcontrollers, simulation seems to be an indispensable tool.

Another is that the traditional 51 microcontroller does not support simulation. If you need the simulation function, you need to purchase a dedicated simulation chip. This operation feels troublesome.

The amount of program code for the 51 microcontroller is relatively small. If there is any problem, we can basically help the LED light flash to find the problem, or we can debug it through serial port printing.

But if you have a poor foundation, you can choose to buy a 51 microcontroller chip that supports simulation to learn.

Introduction to the simulation function of STC microcontroller:

The most commonly used 51 microcontroller by Xi Jinping is the 51 microcontroller of the STC brand. STC's 51 microcontrollers have many models and are divided into many series.

Open the STC-ISP software officially provided by STC and select Keil simulation settings, as shown in the figure below:

In the Keil simulation configuration, we can refer to the models of all microcontrollers that STC supports simulation.

Simulation operation of STC microcontroller:

How to use STC microcontroller simulation:

1. First, you must install the simulation driver. You can install it by clicking the "Add MCU model to Keil" button on this page.

2. Prepare an STC microcontroller chip that supports simulation, and select the corresponding microcontroller model in the Keil simulation setting interface.

3. Set it as the simulation target chip

4. Connect the chip to the computer as shown above.

5. Turn on the power of the target CPU

6. Open the project in Keil software and make relevant settings (refer to the STC Monitor51 emulator usage guide)

7. After the settings are completed, you can start debugging.

8. The simulation monitoring program occupies the P3.0/P3.1 port, but does not occupy the serial port 1.

Users can switch serial port 1 to P3.6/P3.7 or P1.6/P1.7 before using

9. The simulation monitor program occupies the last 768 bytes of the internal extended RAM (XDATA)

During the learning process of 51 microcontroller, we do not need to purchase an emulator, because there is no 51 microcontroller emulator at all.

If you want to realize the simulation function of 51 microcontroller, you can choose a development board that supports simulation function chip.

3. What is the difference between 51 microcontroller and 52 microcontroller?

Both the 51 MCU and the 52 MCU are 8-bit MCUs, but the 52 MCU has richer resources and is an upgraded and optimized version of the 51 MCU.

The 52 MCU has made many improvements based on the 51 MCU, adding many functions that the 51 MCU does not have. It has a smart 8-bit CPU and system programmable Flash, etc.

Main differences:

①The RAM of the 51 microcontroller is 128 bytes, and the RAM of the 52 microcontroller is 256 bytes.

②The 52 MCU is an enhanced version of the 51 MCU. Compared with the 51 MCU, the 52 MCU has one more timer, T2, 128B more RAM, 4K more ROM, 2 more interrupts, and one more watchdog. In terms of power outage, data pointers, etc. There are also some improvements.

③52 microcontroller supports low power consumption function.

④The maximum external crystal oscillator of the 52 microcontroller can reach 33MHz, while the 51 microcontroller is only 24MHz. Some models support internal clocks.

In the actual development process, the 51 microcontroller and the 52 microcontroller are compatible with each other, and there is not much difference. As long as the peripheral resources of the microcontroller can meet the needs, there will be no problem.


Reference address:What is the difference between 51 microcontroller and 52 microcontroller? Is it necessary to buy a 51 emulator?

Previous article:How to use microcontroller LED light-emitting diode to display "love"
Next article:Microcontroller 8X8 LED dot matrix display "Happy Birthday to China"

Latest Microcontroller Articles
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号