-
Landlord, org 0030h.
How do you understand what I mean?
This org is a pseudo instruction, pseudo instruction, which is not the instruction executed by the real MCU CPU, and its role is to be used when the program is compiled. 0030h, this is the rom address, this address starts, you can store the mid-section service program. (That is, behind this pseudo instruction, you write the program, there is, if you don't write it, there is not).
When the program is executed, jump to the main marker, in the process of executing the main program, if there is a single-chip machine to interrupt the request, then the single-chip machine will automatically change the value of the PC register, that is, the program will automatically jump to the 0030h unit to start executing the interrupt service program, and finally to the interrupt return, where to return?
Return to the location where the main program was interrupted.
Let's take a look at the concept of the Break Chapter. Beg.
-
org 0000h represents the program from 0000h, and the next ajmp main represents the program from here to main: this label here, org 0030h represents the program from the address 0030h, because before this address, there are timers, interrupts, etc., from here, there is a role in interference.
RET means return, that is, the program is executed here, from there, and there.
End means end.
-
The org directive is used for linking, not for assembly. That is, it is not an instruction from the CPU, but a pseudo instruction for the compiler to see. That is, these pseudo-directives are for the compiler and not for the CPU, and are used when the compiler links to generate a HEX file.
-
Summary. The MCU program is a special computer program, which is specially designed for the MCU to control the operation of the MCU. It is a low-level language that can control the hardware of the microcontroller, such as input and output ports, timers, interrupts, memory, etc.
The writing of single-chip microcomputer programs requires familiarity with the hardware structure of single-chip microcomputer, as well as familiarity with single-chip microcomputer programming languages, such as C language, assembly language, etc. The process of writing a single-chip microcomputer program needs to go through design, coding, debugging, testing and other steps to ensure the correctness and reliability of the program.
The MCU program is a special computer program, which is specially designed for the MCU to control the operation of the MCU. It is a low-level language that can control the hardware of the microcontroller, such as input and output ports, timers, interrupts, large storage of state calendars, etc. The programming of single-chip microcomputer requires a bad core to be familiar with the hardware structure of single-chip microcomputer, as well as familiar with single-chip programming language, such as C language, assembly language, sail vertical, etc.
The process of writing a single-chip microcomputer program needs to go through design, coding, debugging, testing and other steps to ensure the correctness and reliability of the program.
Can you add, I don't quite understand it.
Problem: The reason for the compilation error of the MCU program is that there may be a syntax error in the program, or the instructions used in the program are not supported, or the variable names used in the program do not conform to the programming specifications.
Workaround:1Check the program for syntax errors, such as whether the parentheses match, whether the variable names are correct, and so on.
2.Check if the directives used in the program are supported, if not, you can try to use other directives instead. 3.
Check that the variable names used in the program conform to the programming specifications, and if not, you can try to change the variable names. Personal Tips:1
When writing a microcontroller program, it is necessary to carefully check whether there are any syntax errors in the program, and whether the instructions and variable names used conform to the programming specifications. 2.Try to use a more concise ** to reduce the likelihood of errors.
SCM program compilation refers to compiling the SCM program source ** into a machine code that can be recognized by the machine, so that the MCU can correctly execute the program. During the compilation process, the compiler checks the program for syntax errors, as well as the directives and variable names used that conform to the programming specifications, and if there are errors, it reports a compilation error.
-
Figure 1 Figure 2
Figure 4 Figure 5
Figure 6 Figure 7
Figure 8 Figure 9
Figure 10 Fourth, power off the single-chip microcomputer development board to ensure that LED2 is off.
Step 1: Power off the board.
Figure 11, Figure 12
Figure 13 Figure 14
-
As well as getting started with a breadboard microcontroller:
MCU Programming School of Magic:
Happy New Year to you!
-
You have to learn both, first learn assembly, so that you can have an understanding of the hardware structure of the microcontroller. After that, I will learn C language, because programming is fast, it is closer to human language, and it is also easy to port.
-
I think it depends on personal needs, the compilation is efficient, and the words of C are written quickly.
-
The teacher of Yixue.com believes that it is best to know a little C language. Although assembly language is still widely used in single-chip programming and technical communication, the use of C language is gradually becoming popular, therefore, if you can understand the C program written by others, it will undoubtedly bring language convenience to learning programming, expand your horizons, absorb more knowledge nutrition, and write your own C program without language barrier.
Bookstores now have books that specialize in MCU C language for sale, and it is recommended that SCU learners who have not yet started C language buy such books.
-
Someone came to tell you that you will learn C language first and use Guo Tianxiang's MCU tutorial The effect is very good, so that you can learn what you need from shallow to deep.
-
If it is purely for learning microcontrollers, and the time is relatively limited, then it is very important to learn assembly language first, and mastering assembly language is also helpful to master the structure of microcontrollers However, if you consider from a general, compatible and long-term perspective, it is necessary to master C language. It's best to try to learn both, and they'll complement each other! The learning effect is better than the comparison
-
If you have to say it, C language is the most used, but it's best to know everything, otherwise you will regret not learning compilation after learning it in the future.
-
I think the compilation is better, but now it seems that the compilation is a bit old. C, on the other hand, is more flexible. So if you're just starting out, choose C. Come on! I'm optimistic about you!
-
It shouldn't be a big problem, is the keyboard 8 or 4*4? Let's design a circuit diagram for you and give it a try. The software is also very simple, so I won't make it up.
-
Are you looking for design or guidance?
-
Can I say I've done a similar course? In fact, it's not difficult to think about it now!
-
The current limiting resistance is determined according to the luminous voltage and current of the light-emitting diode and the maximum bearing capacity of the IO, the luminous voltage of the general light-emitting tube is about 1 more than 1 mA, if the maximum current capacity of the IO of the single-chip microcomputer is 10mA, if it is 5....
-
Let's start with the 51 microcontroller!
You use a P1 port to control the dynamic scanning of 8 digital tubes, and the dynamic scanning display of digital tubes needs to be blanked. >>>More
Hello: I wrote the program:
#include >>>More
Summary. Please tell me about the specific question, dear. >>>More
How is your light-emitting diode connected, if there is a power supply stringed to the light-emitting diode, the low level will be on, if it is the output port of the single-chip microcomputer, it will not be on.
void key0()
if(p1_0!=1) *If the key 0 is pressed. >>>More