SCM learning experience

Label: SinglechipExperience sharingEmbedded developmentprogrammingEngineer
486 people read comment(5) Collection Report

SCM learning experience

Motto: since the choice, don't give yourself leeway

SCM knowledge is not necessarily in the university to read the relevant professional in order to learn, walking in the community can also learn very fine. Everything is difficult at the beginning, the first step is half the success. Since the choice is not left to their own way, so that you will be successful. I am a good example of myself: two years ago, I graduated from the school, I am an idiot on the MCU knowledge, its no concept. I read the normal professional, but after graduation do not want to be a teacher, with a little C language basic knowledge of my last choice of microcontroller embedded development work direction. After an acquaintance introduced me into an electronic product development company, because I do not understand the microcontroller, do not understand programming, I can only do the test. Side work to learn microcontroller knowledge, this is the beginning of my! The following is my learning experience of single-chip learning. Divided into three parts:

The first part: the overall understanding of SCM

The second part: modular programming learning

The third part: the principle of the single chip microcomputer


The first part: the overall understanding of SCM

Just contact with the microcontroller, is from the "principle and application of SCM" this book began. At that time very serious word word to see, first look at the basic knowledge of SCM, SCM system architecture, clock, interrupt, etc.. Because there is not a general understanding of the MCU, do not know what the single chip is to do, so look at the book to all do not understand, easy to make difficult, very painful. Even after a number of times to see the clock, timer, serial and other modules, but also do not know how to use the. It is not easy to get the principle of the various modules of the microcontroller, of course, this is only with respect to the person who does not have the relevant knowledge of scm. In fact, this is a kind of numb reading performance, the efficiency of this learning method is very low. Even at this time I still do not know how to use the C language to the microcontroller. Finally, I summarized the main reason is the lack of overall understanding of the monolithic integrated.

Want to avoid the low efficiency of learning should be from the overall understanding of the module to learn. Specific can be divided into the following points:

First: the use of scm;

Want from the overall understanding of the microcontroller should know what the microcontroller can do, the use of SCM in life. The use of SCM in the life of electronic products nowhere visible. For example: hand with electronic form, use the timer module in MCU; household electric cooker, use resistance AD module detection thermistor in MCU; washing machine, air conditioning etc. these electronic products contain at least one or more pieces of mcu. Give more examples, detailed examples of the use of the microcontroller module. This can deepen the overall understanding of the microcontroller, and even cause the interest of learners.

Second: the concept of scm;

After the overall understanding of the microcontroller should know what the microcontroller, starting from the concept of. Single chip microcomputer, also known as micro controller, is the central processor, memory, timer / counter, all kinds of input and output interface, and so on are integrated in a chip integrated circuit chipMicro computer. There is no comparison to the principle of each module, only to explain the function of each module. For example: the central processor is executing instructions and data processing, like the human brain; memory name is used for storing things, here mainly refers to the central processor is required to execute the instructions and data; timer is used to count the time, the counter is used to count the input and output interface is;IO port is mainly used to exchange data, like the electric cooker microcontroller is AD thermistor is read by IO data acquisition. To know what module and its corresponding function.

Third: how to operate a single chip microcomputer;

The operation of single chip microcomputer is the focus of the study.

SCM is also known as micro controller, so that the operation of the single chip microcomputer control. So how to control the microcontroller, according to what the control of the microcontroller, with what control. At this time do not have to worry about learning how to control, with what to control. The first is to allow learners to have a preliminary understanding of how to operate the process of single chip. The most intuitive way is the experience of a single operator to demonstrate the routine or see the operation of the video, I think this is very useful, and the effect is very good. Demonstration of the routine should be as detailed as possible, including the analysis of the schematic diagram, how to build the development environment, the use of high-level language, etc.. This demo is just to let the learners have a knowledge, can not understand. Think of my own learning for a long time, including the principle of each module of the microcontroller are some understanding, but also try to write C language operation of the microcontroller, but the operation of the microcontroller is still very vague. Later is to see the single chip microcomputer operation of each module of the relevant teaching video, my idea is very clear, in the thinking and understanding to enhance a step. (I still keep the relevant teaching video here). Demo or watching the video, the learners naturally know how to operate the microcontroller, MCU control, according to the principle that the use of advanced control language (general use C language), also need a development environment and so on. These three points may be less for beginners to take some detours.


The second part: modular programming learning

From the operation of the MCU demonstration process can be aware of what tools and should have the basic knowledge of SCM programming tools:

At least there is a single chip module is relatively complete development board. Relatively simple, easy to get started is the 51 single-chip. Of course, there is a single corresponding specification, or we don't know how to operate it.

Basic knowledge:

Programming language, the use of development tools, circuit diagram analysis. Programming language in general we are using the C language, C language based knowledge of independent learning; circuit schematic first only requires the analysis of the principle of understanding. Here we can learn the principle diagram of hand development board, can the overall understanding of our programming principle diagram; use development tools such as KEIL, we need to know how to build the environment, create a new project, add files, compile, link, burn etc.. Compiler theory can not be understood for the time being, we do not have an impact on the programming of the MCU, this part of the tool development tools will help us to deal with.

To understand these, we operate the microcontroller's ideas, steps and objectives are very clear. The following sub module programming to explain how to control the microcontroller, so that the microcontroller to achieve our requirements.

Building a project is the beginning of programming. So we must know how to set up a new project before programming, just contact this must be their own hands to operate two or three times. Here the details of the steps I do not start, you can go to see the teaching video, etc..

The module of learning from easy to difficult to control output, IO port of the keys, the master clock frequency, timer, interrupt, serial communication, IIC, - such as the control of IO output the most simple application is to light a LED lamp to light water. It's clear that we're going to have a doubt - how do we operate the output of the IO port. So at this time the most need to solve the problem is to understand the principle of the microcontroller IO port module.

Learning should be divided into the following steps:

First: understand the principle of the module

Second: understanding of the use of the module schematic

Third: the principle of the control module programming

Fourth: compile (including links) to generate the target file

Fifth: burn file verification function

Understanding module theory:

Everything is the same, the use of it must be aware of its principle, the microcontroller is no exception. Control MCU module must be aware of the principle, or no start. The module principle includes the operation of the control register, the function of the module. For example, the IO module: the need to understand the function of the module, drive, control register, IO input and output voltage, input and output frequency and form. For example, a push-pull output, input pull-up, interrupt, IO control enable etc.. Of course, as the 51 single chip is relatively simple, there is no frequency of input and output.

Understanding of the use of the module schematic

The MCU module operation also has a principle diagram, the reason is very simple: we all know that the chip is used to link with the outside of the pin, and each pin function are not the same, that in the end which pins which link to external devices must have the corresponding drawings, which is the principle diagram. As if using IO to control the LED, then we also need to know which IO port connected to the LED lamp. So we had to analyze the good schematic. For embedded software programmer will analysis can be, because the work of the schematic diagram can be said to be done by the electronic engineer.

The principle of control module programming

If you understand the module driver and operation principle, the control of the corresponding function of the preparation of the next is the preparation of the C language work. If the C language of the clearance, it is relatively simple. It is recommended for beginners to each function module C language programming to control what, to see the effect, there will be a comprehensive understanding. After the operation of each function, and then look back to the principle of the module, deepen the impact.

Compiler generated target file

Compile C program is compiled for us to compile, as to why to compile and then generate the target file here for the time being. In fact, this compilation process is very complex, but the work has been handed over to the development environment of the compiler. We want to know the development of the environment in the use of the most basic development tools, including the current document compilation and construction of all the files to compile the operation, compile information to find, debug, etc.. These auxiliary tools can shorten the development time and improve the efficiency.

Burn file verification function

After compiling the source program compiler will generate an object file, if the KEIL development environment, the compiler will have a hex file, we must also put this file burned into the microcontroller to achieve the control of microcontroller internal effect. At the same time it can verify whether the MCU to achieve our original design requirements. This part of the need to understand how to burn the hex file into a single chip memory.

After learning all of the individual modules, the next step is to use more of the modules together to write a small project. Familiar with the flexible use of the function of each module. If you come to this step, congratulations you can basically develop the project. It is likely that you will encounter a lot of problems in the process of development, but it does not matter slowly accumulated experience problems will be less and less. There are many ways to accumulate experience, can through online learning of others project experience sharing, learning experience to develop the project procedures, experience method can solve the problem from their own programming in.


The third part: the principle of the single chip microcomputer

Learn microcontroller programming principles, the system should be on the MCU and the framework of a system of understanding, it is recommended to find a book on the principles of the book read it again. This book you will be easier to understand, certainly not like me, numbness in the beginning without efficiency with a book in the throat.

The principle of single chip microcomputer can be divided into 5 parts:

First: program programming (software development)

Second: source code compilation

Third: target file link

Fourth: Hex file replication

Fifth: single chip operating instructions

For the principles of the 5 microcontroller compiler process, I think it should first use reverse thinking to understand the beginning of a thorough understanding of the beginning. For instance: CPU MCU to run binary instructions and data processing, microcontroller internal instructions and data to know where to get; then it is necessary to solve the internal microcontroller instructions and data from there to burn, this is the hex file, want to know the instructions and data should be placed in the internal microcontroller which position first what is the content of the hex file is a hex file; then come from where, of course is the compiler to compile the source program and the product of the target file. But why use the compiler to compile source program, this is because the microcontroller is the implementation of the binary code, and we write C language source program, microcontroller can recognize the direct recognition of C language, so it is necessary to compile. And how the compiler is compiled, which is the principle of compiler. Then we go back to the source, why should this program, the answer is certainly based on the needs of the actual function to operate the MCU module driven. This is the reverse of the above 5 processes. But for the microcontroller compiler theory, the first process we have explained in the second part, this does not repeat. The most important is the following 4 processes.

Do not open this introduction, the future will continue to add to explain in detail.




step on

Reference knowledge base

Guess you're looking for
View comments
* the above user comments only represent their personal views, does not represent the views or position of the CSDN website
    personal data
    • Visit:3083 times
    • Integral:Eighty-four
    • Grade:
    • Rank:Thousands of miles away
    • Original:5
    • Reproduced:0
    • Translation:0
    • Comments:10
    Classification of articles
    Latest comments