On the Specific Analysis of SCM Delayed Program

We introduced the delay procedure earlier, but this is not perfect, because we only know that DJNZ R6, D2 will be executed 62,500 times, but how long will it take to execute this many times? Does it meet our requirements? We don't know yet, so here's the solution to this problem.

On the Specific Analysis of SCM Delayed Program

Ask a question first: What is the most important in our school. (Ringtones) The principal can be on a business trip, and the teacher can take a break. However, no ringing on the school day must be chaotic. The whole school is under the unified command of the ringtones, stepping in unison and working in a unified and coordinated manner. This bell is ringing on a certain schedule. We can call it "order of time sequence." A unit made up of people still has a certain time sequence, and of course the computer must have strict timing. In fact, the computer is more like a big clock. When the minute hand moves, when the second hand moves, and when the needle moves, there are strict rules, which cannot be confused at all. What the computer has to accomplish is more complicated, so its timing is more complex.

We know that when computers work, they fetch instructions one by one from the ROM and then execute them step by step. We specify that the time a computer accesses a memory is called a machine cycle. This is a time benchmark, as if we use "seconds" as our time base. Why not use "seconds", how good, and how to get used to it, and we will learn to use "seconds" instead of being used to them.

One machine cycle includes 12 clock cycles. Let's calculate how long a machine cycle is. Set up a one-chip computer and work in 12M crystal oscillator, its clock cycle is 1/12 (microsecond). One of its machine cycles is 12*(1/12) which is 1 microsecond. (Please calculate a microcontroller operating on a 6M crystal oscillator. What is the machine cycle time?)

All of the instructions of the MCS-51 microcontroller have been completed relatively quickly, as long as one machine cycle is on the line, some have to be completed slowly, two machine cycles are required, and two instructions require four machine cycles. It's not hard to understand again, is it? I'll let you sweep the implementation of the implementation of the total time than you have to complete the instructions to clean the blackboard longer. For the length of the constant instruction execution time, a new concept is introduced: the instruction cycle. The so-called instruction cycle refers to the time for executing one instruction. INTEL gives its instruction cycle number for each instruction. Most of these data do not need us to remember, but there are some instructions that need to be remembered. For example, the DJNZ instruction is a two-cycle instruction.

Let us calculate the delay just now. First, we must know the frequency of the crystal oscillator. We set the crystal oscillator to be 12M, and one machine cycle is 1 microsecond. The DJNZ instruction is a two-cycle instruction, so it takes 2 microseconds to execute. A total of 62,500 executions were performed, exactly 125,000 microseconds, or 125 milliseconds.

Lithium Battery CR17505

Lithium Battery Cr17505,3V Lithium Battery,Smoke Detector Batteries,Battery For Smoke Alarm

Jiangmen Hongli Energy Co.ltd , https://www.honglienergy.com