The system instruction cycle of the microcontroller varies according to different core architectures.
The 8051 series microcontroller uses a synchronous sequential logic system. The operation of the entire system is completely dependent on the clock signal inside the system. Its instruction cycle, machine cycle, etc. are also determined by the clock pulse signal. The following explains the relationship between the machine cycle, instruction cycle, etc.
Clock cycle: also called clock oscillation period, refers to the pulse generated by the crystal oscillation. One pulse represents one clock cycle.
State cycle: In the 8051 microcontroller, one clock cycle is defined as one beat (indicated by P), and two beats are defined as one state cycle (indicated by S). One state cycle is equal to two clock cycles.
Machine cycle: Also commonly called CPU cycle, it indicates the shortest time to read an instruction word from memory. It is the smallest unit of instruction cycle. It is equal to the cycle length of a single instruction. One machine cycle is equal to 6 state cycles.
Instruction cycle: An instruction consists of one or more machine cycles. All C language codes will eventually be compiled into assembly code for execution, and the machine cycle required to execute an assembly instruction is called an instruction cycle.
The clock cycles of different instructions are different. For the 8051 core, the clock cycles of the same instruction are also different. As can be seen from the figure below, the MOV instruction takes one machine cycle to put the register value into the accumulator, and the MOV instruction takes two cycles to put the value in the direct address into the accumulator. For the same instruction, the instruction cycles of the 8051 and 90 series microcontrollers are also different. The 8051 series takes 12 clock cycles to execute a single instruction, and the 90 series takes 6 cycles to execute a single instruction. They all require one machine cycle, but the 90 series only needs 6 clock cycles for one machine cycle.
The NOP instruction we often use is a single instruction that requires one machine cycle. The 8051 requires the crystal oscillator to generate 12 pulses.
8051 Baidu Encyclopedia: 8051 is an 8-bit single-chip microcontroller , a type of MCS-51 single-chip, manufactured by Intel in 1981. INTEL licensed the core technology of MCS51 to many other companies, so many companies are making single-chip microcomputers with 8051 as the core, such as Atmel , Philips , Shenzhen Lianhua and other companies, and have successively developed more functional and powerful compatible products.
CORTEX-M0 M3 M4, etc. use the ARMv6-M, ARMv7-M, ARMv8-M Thumb instruction sets and a three-stage pipeline process. The M3 has a branch prediction function that can prefetch instructions for the branch target address, reducing the branch delay to one clock cycle.
The instruction cycle of the CORTEX-M series is uncertain. On the one hand, there is a delay when the MCU fetches instructions from the Flash. On the other hand, the Cortex instruction set does not have a fixed cycle. Especially after the branch prediction was added to the M3, the results of branch instructions on different Cortex-M models are different.
over.
Previous article:About the address bus and data bus of the microcontroller
Next article:W77E58 chip introduction
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- The impact of high temperature on LED display
- [Gizwits Gokit 3 Review] Part 4: Temperature and humidity monitoring and computer power on and off
- Basic knowledge of inductance
- When installing AltiumDesigner20, the Unable download extension IPC Footprint Ge...
- Today afternoon 14:00 live broadcast [Latest TI C2000 real-time control chip - F28003X]
- SPI slave returns data to the host in dislocation
- SensorTile.box V335 Firmware
- SensorTile.box IoT-related application supplementary content
- Introduction to DDS Principle (Chinese).pdf
- [Original] [Ultra-low power STM32U5 IoT Discovery Kit] - 3: BLE-1