Microcontroller Getting Started Notes

Publisher:温暖的微风Latest update time:2016-09-25 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The "EMC MCU Special Topic" of this blog is about my work experience in the past two years. Because EMC information is relatively scarce, unlike MCS-51, many beginners encounter difficulties and feel helpless. I also deeply experienced this when I first started. I feel a little tired recently and want to take a break. But I feel a little unwilling to leave like this. I am an open source enthusiast. While greedily absorbing other people's code, I think I should do something myself. The overall environment in China is not good. Many engineers keep their own experience strictly to themselves, which I think is not good. Of course, the project code involves legal protection, which is understandable, but some small experiences, some small device processing methods, etc. can be shared to help others take fewer detours.

 

When reading this article, I assume that you have learned at least one type of microcontroller, and at least the basic theories, such as the principles of basic units such as interrupts and timers, which you should master. The article will not explain them in detail. At the same time, if this is your first time to use EMC microcontrollers, you must spend at least a week to get familiar with the basic hardware architecture and basic assembly instruction set of EMC microcontrollers.

 

A few principles:

If you use the old version of the assembly compiler Elan Wice, you must use external software to write and modify the code (Ultra Edit is recommended), because the editor that comes with Elan Wice is defective. When writing a program, it will inexplicably delete an extra line of the program, or inexplicable symbols will appear, and it does not support Chinese characters well. These are extremely prone to logical errors, and it may take a long time to check if you are depressed. You should try to avoid them. The new version of Wice Plus (supports C language) solves these problems, and it is not mandatory to use an external code editor.

 

If you use the simulator with AC power (AC 220V) for simulation, you must add an isolation transformer to the target board, otherwise the simulator will burn out. Because the simulator uses a parallel port line, the "ground" of the parallel port is connected to the "ground" of the switching power supply. If the target board is connected to the mains, a loop will be formed with the simulator, and the large current will burn the simulator, so be careful when using it. As for the principle of isolation, you can refer to the knowledge of analog electronics and coupling transformers, which will not be explained here. The specific isolation method is shown in the figure below:

 

Third, don't take it for granted. The E78PXX series has developed to a large number of MCUs. Each MCU is different, especially when it comes to programming. So don't take it for granted that the EM78P156 program can be directly put on the EM78P447. In fact, you are wrong. Whether it is the entry address, interrupt address, interrupt pre-processing, register settings, they are all different. Doing it carelessly will only make you suffer a big loss. So you must read the chip information carefully before using each MCU. If you often need to use several different chips, you can do several "program frameworks" like me and use them directly. These will be discussed in the following chapters.

 

Fourth, don't doubt the MCU too much. If you hear that EMC is not good on the Internet, then when something goes wrong, you blame the MCU, but never reflect on your own program problems. I have seen many people call us for technical support. In the end, the problems were basically not caused by the MCU or the emulator, but by poor program processing, and some were simply written incorrectly. Therefore, it is good to have more self-examination when writing programs.

 

Learn to find errors independently. After 2 years, if you ask me what I have learned, I can say without hesitation that I have learned to find problems quickly! ! I remember that when I started working on EMC microcontrollers, I was very depressed when I encountered problems, and it basically took several days to find the problem. But now it is different. Basically, it takes less than 1 minute to locate the problem. I think this is what is called work experience. Of course, this experience is hard-won. When browsing the forum, I found that many beginners like to ask questions as soon as there is a problem, and then post a lot of programs. What I want to say is that since you wrote the program yourself, you should find the error yourself. The worst case scenario is to change the code and rewrite it. Whenever you encounter a problem, ask immediately. Of course, this problem will generally be solved, but what you have learned is "this problem" rather than "this type of problem." The next time you encounter a slight change, I guess you will still be dumbfounded. Therefore, the root of the problem is to learn to find problems by yourself, exercise the ability to think independently, and solve problems independently, which is very beneficial. Of course, if you say that writing programs is just for a meal and you are not obsessed with technology, then you can ignore what I said. This is not preaching, but just a little experience I have personally experienced.

 

Mountain roads are always the most difficult to walk on, but the scenery on the top of the mountain is always the most beautiful. However, only a few people can see this beautiful scenery. Of course, I hope you are one of them. All technical staff, let's encourage each other.

Reference address:Microcontroller Getting Started Notes

Previous article:MCU Multiplication and Division Examples
Next article:Single chip microcomputer time sharing concept

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号