1. Clock cycle, also known as oscillation period: defined as the reciprocal of the clock pulse, which is equal to the reciprocal of the crystal oscillator in a single-chip microcomputer.
In the 51 single-chip microcomputer, one clock cycle is defined as one beat (indicated by P), and two beats are defined as a state cycle (indicated by S).
The clock cycle is the smallest unit of time in a microcontroller.
Eg: For a microcontroller with a 12M crystal oscillator, the clock period = oscillation period = 1/12 us.
2. Machine cycle: The time required to complete a basic operation is called a machine cycle.
In a computer, for ease of management, the execution process of an instruction is divided into several stages, with each stage performing a basic operation.
Such as: instruction fetch, memory read, memory write, etc.
In the 51 MCU, one machine cycle consists of 6 state cycles, that is, 12 clock cycles = 12 x 1/12 us = 1 us
The machine cycle is defined because the clock cycle time is too short to do anything.
3. Instruction cycle: It is defined as the time required to execute one instruction.
Generally, instructions that contain one machine cycle are called single-cycle instructions, such as MOV instructions, CLR instructions, etc.
Instructions that take two machine cycles are called two-cycle instructions.
There are also four-cycle instructions.
The most reliable way to determine whether an instruction is a single-cycle instruction or a two-cycle instruction is to look up the instruction table. I found a summary of the rules on the Internet.
This rule should be judged in order. The first principle is higher than the last one (mainly 2 to 6). Whichever one is met in order is the one that belongs to it.
one type:
1. MUL and DIV: the only 4-cycle instructions
. 2. Instructions including DPTR and PC are all 2-cycle instructions.
3. All absolute jump and conditional transfer instructions are 2-cycle instructions.
4. All instructions including the A register are single-cycle instructions.
5. Among the bit operation instructions, ANL and ORL are 2-cycle instructions.
6. All instructions containing immediate addresses, except INC direct and DEC direct, are 2-cycle instructions.
7. The rest are single-cycle instructions.
Now, the commonly used microcontroller program writing software is Keil. After writing the program, we can use software debugging to determine the time required for program execution, and we can also see each instruction:
Previous article:Digital tube display STC89C54RD+DB18B20 temperature measurement board
Next article:LED water light program one-dimensional array writing method
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- At 10:00 this morning, we invite you to listen to the award-winning live broadcast: ADI's digital active noise reduction headphone solution allows technology to calm us down~
- Common MOS tube models and parameter comparison table
- From terminals to architecture, TE Connectivity (TE) helps you connect to the 5G high-speed future. Watch the video and answer questions to win gifts!
- ST's latest evaluation activity! Get the first-hand experience of the NUCLEO_G431RB development board here
- Some points to note when designing CC2530 2.4G ZigBee low power PCB
- Unveiling the secrets of NB-IoT modules DRX, eDRX, and PSM (Part 1)
- About the development process of the transmission control unit TCU
- EEWORLD University Hall----Live Replay: Microchip's Trusted Platform for CryptoAuthentication? Series
- [CY8CKIT-149 PSoC 4100S Evaluation] + LED switch counting and LCD display (final report)
- What are the factors that have a huge impact on PCB assembly mechanism?