What should you learn before learning microcontroller? What is the relationship between C language and microcontroller?

Publisher:fnfeecjknqucLatest update time:2023-01-05 Source: zhihu Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

What should you learn before learning microcontroller? Mentioning this reminds me of the history of blood and tears when I started studying microcontrollers.

In 2008, I joined the school's electronics laboratory to prepare for the 2008 National Electronics Competition.

The electronics competition in 2008 is divided into three categories: hardware design, microcontroller software, and product debugging .

The current competition should be changed.

I chose the software category. The reason I chose this is that I think it is more mysterious. It is this mystery that makes me more interested in software.

I really didn’t know anything about it at the beginning. I bought a C language book , studied it alone for 2 months , took 3 notebooks , and then studied digital circuits for another month . By this time, I was almost exhausted. , 3 months have passed and I still don’t understand anything!

At this time, I was ready to give up. Finally, I thought: I have to finish the road I chose on my knees.

It just so happened that I had a lot of free time every day, so I took the attitude of learning while playing. You may not believe it, but I unknowingly learned the IO port, timer, interrupt, and serial communication of the microcontroller.

At that moment, I was thinking that microcontroller development is not so mysterious! Ha ha!

Looking back on my own learning process, it is still very unforgettable. I believe that many of my friends may still be like me, persisting for a while, making no progress, and always being confused in the early stages of entry.

In fact, the microcontroller is just a tool. Before learning this tool, you still need other knowledge as a foundation.

For example, basic digital circuit foundation and simple C language programming foundation .

1. What to learn about circuit basics and C language basics

1. What do you need to learn about the basics of digital circuits?

Mastering the basic usage of resistors, capacitors, and transistors, and mastering the concepts of high and low levels of microcontrollers is basically the same.

The best learning channel is the schematic diagram of the development board. If you understand the schematic diagram of the development board, you can basically do some projects.

2. C language programming basics

To learn the basics of C language, you must master some basic syntax and the definition of variables.

For specific learning paths, you can go to Xiaopo Station to find Wuji Microcontroller Programming, which is more systematic and comprehensive, and is also focused on microcontrollers.

After learning the knowledge of microcontrollers, circuit basics, and C language, you can start working on some projects. Start with small projects in the early stage, such as electronic clocks.

2. What is the relationship between C language and microcontroller?

Through the previous explanation, I believe everyone already has a little idea.

Next, I will give you an in-depth explanation of the relationship between C language and microcontroller.

The microcontroller supports C language and assembly to write programs.

1.  Written in C language

The program written in C language ultimately needs to be compiled into a .hex file that can be recognized by the microcontroller through the keil tool:

C program source code->C compiler->Assembly code->Assembly compiler->Machine code (.HEX  or .BIN)

2. Written through assembly

In the early days, the programs of microcontrollers were all assembly codes. The assembly code is closest to the low-level language at the bottom of the hardware and runs more efficiently.

However, assembly language has many obvious shortcomings: it is inconvenient to read, has poor portability, and is difficult to develop, etc. With the continuous advancement of technology, people have gradually begun to use C language to replace assembly language (lower-end chips are still Requires assembly to develop).

Therefore, general product development uses C language, and assembly is generally used to make small products or startup files for microcontrollers.


Reference address:What should you learn before learning microcontroller? What is the relationship between C language and microcontroller?

Previous article:Can I learn microcontroller in one month? How long does it take to learn microcontroller programming?
Next article:How much C language foundation is needed to learn microcontroller, C language microcontroller programming tutorial

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号