51 MCU engineers share their own arm development experience

I saw a lot of friends who are doing electrical engineering design in the discussion: How to learn how to learn? "Single-chip and embedded system applications" Xiaobian for everyone to find such an engineer, talk about his practical experience.

2.png

I used to use 51, but it has always been C51. I have more than 10 years of experience in C language. I used it very little. Later, I turned to ARM because of the project. I didn't know anything about ARM at first. I read this "ARM Architecture and Programming" is also in the fog, but perhaps because the ignorant is fearless, I just built a project in MDK, added the built-in Start the file, and then do a main function, which does not operate any hardware in an infinite loop, actually ran. Then based on this, slowly began to control GPIO and serial communication, suddenly found that my project is not engaged in doing this? What other operating modes, what link registers, what PC registers are off my bird, I just It is enough to control the peripherals. As for how it is implemented, that is the thing of the compiler and linker.

Looking back now, it is still very simple to think about developing ARM. Especially if you use MDK, you will be able to do some simple development. Don't be confused by those weird things. Learning while developing, the project is deep, and those things naturally understand. Our company has a newcomer, I usually ask him to do something simple, such as buttons, serial ports, etc., it will almost be done.

Luo Wei said a few suggestions for so long:

1. ARM's assembly does not need to be proficient, you can probably understand it. I usually need to look at it when debugging. If a speed is demanding and you need to use assembly, I think what you need more is to change the mind and modify the algorithm. For example, use a table to replace calculations. I have done 5 years of ARM development, completed n projects, and have not written a compilation so far.

2. Because of the real-time and cost requirements of industrial control, I generally do not use the operating system, but I will implement some memory management, event management, mailbox and the like. These take time to accumulate, usually write the program to pay attention to generalization, and then build your own library, it will be cool after use. I have used some operating systems before, and found that it did not improve my development speed, but also caused problems in debugging. I couldn't find a bug.

3. For the company, if the project needs to use the operating system, network, gui, file system, etc., it is better to buy a board directly, and everyone has already done it, and there are very few bugs. Just fine. If you have a large amount, you can customize it, and you can calculate the development cost, which may be cheaper. If you are personally interested, then when I didn't say it.

4. Now there are ready-made libraries for peripherals. I suggest you not to use them or not. Because you want to use these libraries well, you must be familiar with the peripheral registers. At this time, you can write one yourself, and a simple register assignment, the function library often needs to call a function to achieve, too luxurious. But for computing libraries still need to use, such as DSP libraries, etc., after all, people write a certain efficiency is higher.

5. Use interrupts, which is the same for 51 and ARM. There is absolutely no need to poll for the place where the interrupt can be used. The interrupt is the soul of the microcontroller, and all your programs should be deployed around the interrupt.

6. Learn C language well, pay attention to form your own programming style, start with function name and variable name, and write more comments. Don't be afraid of trouble, these are very important. I always think that the best program style is that you can understand the program immediately without having to read the comments: the program is the comment. I sometimes write things like a=b-2-1, don't think it's silly, it's because 2 and 1 represent two things, and writing 3 directly adds difficulty to understanding, and this It also does not reduce efficiency, the compiler will translate it into a=b-3.

7. For the C language Dorothy, use the pointer, if the interrupt is the soul of the microcontroller, then the pointer is the soul of C.

In a word, doing ARM and doing 51 is almost the same, the key is the register operation of various peripherals.

ZGAR FIT

ZGAR FIT

ZGAR electronic cigarette uses high-tech R&D, food grade disposable pod device and high-quality raw material. All package designs are Original IP. Our designer team is from Hong Kong. We have very high requirements for product quality, flavors taste and packaging design. The E-liquid is imported, materials are food grade, and assembly plant is medical-grade dust-free workshops.

From production to packaging, the whole system of tracking, efficient and orderly process, achieving daily efficient output. We pay attention to the details of each process control. The first class dust-free production workshop has passed the GMP food and drug production standard certification, ensuring quality and safety. We choose the products with a traceability system, which can not only effectively track and trace all kinds of data, but also ensure good product quality.


We offer best price, high quality Vape Device, E-Cigarette Vape Pen, Disposable Device Vape,Vape Pen Atomizer, Electronic cigarette to all over the world.

Much Better Vaping Experience!



E-Cigarette Vape Pen,Disposable Device Vape,Vape Pen Atomizer,Latest Disposable E-Cigarette OEM vape pen,OEM electronic cigarette

ZGAR INTERNATIONAL TRADING CO., LTD. , https://www.zgarvapepen.com